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

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -