javascript - a jQuery show() that accepts a value? -


is there shorter way write this?

if (somebool) {     $dom.show(); } else {     $dom.hide(); } 

jquery's toggleclass function can called toggleclass('class', somebool) add or remove class depending on value of somebool. i'm looking function in jquery showing/hiding elements.

it similar toggleclass:

$('selector').toggle(somebool); 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

javascript - addthis share facebook and google+ url -

ios - Show keyboard with UITextField in the input accessory view -