javascript - jQuery wrap only around string -


I'm working on some jQuery code to start

   

In

  & lt; Block & gt; & Lt; X & gt; Citation & lt; / X & gt; & Lt; Cite & gt; Author & lt; / Cite & gt; & Lt; / Blockquote & gt;  

So far, I'm trying to loop through each block quote, by separating the element, using the jQueries wrapInner function to wrap the remaining string in the element, then the element Add again.

Edit: The ultimate goal is to do something like this. In addition to using jQuery to automate the appointment of .bqstart; .bqend

I'm new to javascript jQuery, though I have experience in many other coding languages, so I'm not sure how to implement it and if it is to get me to meet it correctly is . Hey, I'm not even sure the title of this question is justified. Some guidance would be greatly appreciated: P

EDIT2: For anyone in the future, or anyone curious, here's the code that I have ended

You can check the node type to childNode s, if the value is 3, the node is one textNode .

  $ ('blockquote'). material (). Filter (function () {return.nodeType === 3 & trim (this.nodeValue) .length;}). Wrap ('& lt; q / & gt;');  

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -