css inside of html inside of javascript? Try making a custom class for a hidden node and toggling the class instead of altering the style directly. It'll make your life 100x easier.