What is the difference between
$(\"#myid\").attr(\"style\", \"visibility: hidden\")
and
$(\"#myid\").css(\"visibility\", \"hidden\"
Doing this:
$("#myid").attr("style", "visibility: hidden")
Will leave only this style attribute, while doing this:
$("#myid").css("visibility", "hidden")
Will add (or set) this style attribute.
Here's an example, the first will always result in this:
style="visibility: hidden;"
The second just adds visibility so your style may now be:
style="width: 50px; color: red; visibility: hidden;"