hinzufügen und entfernen der Klasse, um eine id

Wenn ich auf die Klasse zeigt, die die id 's nicht wieder der Klasse zu verstecken
Können Sie mir helfen?
Dank

CSS

    .hide{color: red}
    .show{ color: green}

HTML

<div id="prova" class="hide">
    prova
</div>

jQuery

$(document).ready(function()
    {
        $("#prova.hide").click(function()
        {

            $(this).removeClass();
            $(this).addClass("show")
        })
        $("#prova.show").click(function()
        {

            $(this).removeClass();
            $(this).addClass("hide")
        })

    })

InformationsquelleAutor the_martux | 2013-05-03

Schreibe einen Kommentar