How to set “style=display:none;” using jQuery’s attr method?

Why not just use $(‘#msform’).hide()? Behind the scene jQuery’s hide and show just set display: none or display: block. hide() will not change the style if already hidden. based on the comment below, you are removing all style with removeAttr(“style”), in which case call hide() immediately after that. e.g. The reverse of this is of … Read more