What is the difference between
$(\"#myid\").attr(\"style\", \"visibility: hidden\")
and
$(\"#myid\").css(\"visibility\", \"hidden\"
Nothing. Just two ways to accomplish the same goal.
The first will overwrite any existing style settings. If you had:
It would become:
The second will add the visibility setting to the existing styles. So:
Woudl become:
If there's no style attribute already set, then the two will produce the same end result.