jquery - How to addClass and removeClass in the simplest way -


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;    

Instead of addClass () and (client ), Do not use only:

Similarly:

  $ (".psselectedDD"). Toggleclass ('dn db');    

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -