jquery - How to get the class name of a child element with content “XX”? -
How to get the class name of a child element with the content "This is active"? I know the id
name 1 with the original element div
.
& lt; Div id = 'name1' & gt; & Lt; Div class = 'name 2' & gt; & Lt; Period & gt; & Lt; One square = 'active name a' & gt; It's active & lt; / A & gt; & Lt; / Span & gt; & Lt; / Div & gt; & Lt; Div class = 'name1' & gt; & Lt; Period & gt; & Lt; One class = 'no-active' & gt; Not active & lt; / A & gt; & Lt; / Span & gt; & Lt; / Div & gt; & Lt; / Div & gt;
You can try this approach:
< Code> warning ($ ("A: happens ('this is active')"). Et ("square"));
Comments
Post a Comment