Javascript examples for Object:Constructor
Represent the object name by the function parameter
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/* w w w. ja v a 2 s. c o m*/ function AddStyle(prob, value) { Elem = document.getElementById('box'); Elem.style[prob] = value; } AddStyle('color', 'green'); } </script> </head> <body> <div id="box"> Hello </div> </body> </html>