jquery - wrap only text inside a span -
How do I hide content just inside the span and leave the tag?
What is the markup ...
& lt; span class = "foo" & gt; & Lt; Span class = "bar" & gt; + & lt; / Span & gt; Lorem ispum laurem ispamlarem esphelarem asasp & lt; / Span & gt; Now this is what I want
$ ('.foo'). wrapInner ('& lt; span class = "foobar" / & gt;') is wrapping the entire internal content. Thanks in advance ..
You have to filter the node and then wrap it . Use Try it:
$ ('.foo'). Each (function () {$ (this) .contents (). Eq (2) .Wrap ('& lt; span class = "focus" /> gt;');});
Comments
Post a Comment