Cheery Moose logo
www.cheerymoose.com

Changing CSS Properties

This page demonstrates modifying CSS properties in JavaScript using the setAttribute() and removeAttribute() methods. Thanks to Mozilla for the attribute listing code as I was having difficulties figuring out how to parse a "NamedNodeMap".

I also learned (the hard way!) that you cannot use setAttribute() to change the "hidden" property to false because it does not work. You have to use removeAttribute() to display the element, and setAttribute() to hide again.


Lorem ipsum dolor sit amet, mea ne agam facete. Clita constituto vituperatoribus ne pro, his ut nisl aeterno. Quo latine consequuntur ei, ei est lorem labitur fierent. Impedit gubergren id sit, ut sensibus perpetua eos. Has utinam elaboraret cu, at laoreet tractatos imperdiet quo, eu atomorum forensibus adversarium sea.


Element Attributes: