jquery - read contents from $(this) selector and its children separately? -
$ (this) How to read the content of the selector and his children separately?
& lt; Div class = "paragraph" & gt; & Lt; H1 class = "hd" & gt; Title 1 & lt; / H1> Advertise on this website Now after starting, it best wishes to you for a lot of competitions for the eligibility of the class, according to our competitor, & lt; / Div & gt;
I & lt; H1 & gt;
can use the content of $ (this) separately. Children ("h1") Text () but how do you & lt; H1 & gt;
?
Thanks
You can get content like this:
$ (this) .clone (). Children ("h1"). Remove (). End (). The text ()
, which is cloning the element we are doing, from that clone & lt; H1 & gt;
, then the text will be received.
Comments
Post a Comment