views:

249

answers:

1

Hi, instead of

domA.style.display = "none"; 
domA.style.display = "block;

I could not find such functions in the library, but I guess they must have it somewhere.

+7  A: 
<html>
<head>
<script src="http://closure-library.googlecode.com/svn/trunk/closure/goog/base.js" type="text/javascript"></script>
<script language="JavaScript">
    goog.require('goog.style');
</script>
</head>
<body>
   <div id="myElement">test</div>
</body>
</html>
<script> 
    goog.style.setStyle(goog.dom.$("myElement"), "display", "none");
    // or
    goog.style.showElement(goog.dom.$("myElement"), false);
</script>
andres descalzo
according to what folks say on closure group, $ functions will probably be removed in favor of goog.dom.getElement('myElement') style functions
Evgeny