javascript - jQuery hasClass doesn't work for me? -


In the following code, hcl does not work and the result is false. Why do I, in the warning?

Online demo:

HTML:

  & lt; Span & gt; & Lt; Div class = "add" & gt; & Lt; / Div & gt; & Lt; / Span & gt;  

JS:

  Warning ($ ('span'). Hcl ('add'));  

I think there may be misunderstanding what you can do. It checks whether one of these elements has been entrusted to one. From:

Determine whether any of the matched elements is assigned to a given class.

If you want to see that element / Em> use an element with that class:

The set of matching elements Reduce those people who have ancestry that match the selector or DOM element.

is alert ($ ('span'). ('Add'). Length> 0);

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -