Hi folks,

I was looking at the toggleClass method in the API, and it says this:

    jQuerytoggleClass( String class  )
    Adds the specified class if it is present, removes it if it is not present.


I'm finding myself confused by this. The example shows:

    Example:
    $("p").toggleClass("selected")

    HTML:
    <p>Hello</p><p class="selected">Hello Again</p>

    Result:
    [ <p class="selected">Hello</p>, <p>Hello Again</p> ]



Shouldn't the API read: "Adds the specified class if it is NOT present, removes it if it IS present."

How can you remove something that is not present? It's not there to be removed.

Is this a genuine typo or am I missing something? :o)

Chris


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to