views:

232

answers:

2

If I have changed a CSS rule via javascript, do I need to do anything to "refresh" the browser to redisplay the current page using the updated rules?

+8  A: 

No--a refresh isn't necessary--and if it did occur it would restore the document to its original state.

The change should take place immediately (setting display: none, for example). Use FireFox plugin FireBug (http://getfirebug.com/) or the IE Developer Toolbar (built into IE8 and available as a free plugin for previous versions) to dynamically view the HTML to ensure the change you think is taking place is actually occurring.

rp
A: 

Changing CSS properties on the fly via JavaScript should automatically make the change in the user's web browser unless there is something wrong with your script of if the user has JavaScript turned off.

TheTXI