jquery - How to addClass and removeClass in the simplest way -
Instead of Similarly: addClass and
The shortest way to toggle the hidden element using the removeClass What is a one click event has been received after a certain other element.
& lt; Script type = "text / javascript" & gt; $ (Document) .ready (function () {$ ("# pps_Link"). ('Click', function (evt) {evt.preventDefault (); var pssd = $ (". PsSelectDD"); if (! Pssd.hasClass ("db") {pssd.removeClass ("dn"). AddClass ("db");} And if (! Pssd.hasClass ("dn")) {pssd.removeClass ("db") AddClass ("Dn")} evt.stopPropagation ();});}); & Lt; / Script & gt;
addClass () and
(client ), Do not use only:
$ (".psselectedDD"). Toggleclass ('dn db');
Comments
Post a Comment