'className' Example : className : Javascript Properties : JavaScript Reference examples (example source code) Organized by topic

JavaScript Reference
C++
PHP
JavaScript Reference Home »  Javascript Properties   » [  className  ]   
 



'className' Example

    
<html>
<head>
<script language="JavaScript">
    function function1() {
        document.getElementById("myP").className = "myC"
    }
</script>
<style>
.myC 
    font-family:verdana, arial; 
    font-weight:bold; 
    font-size:16px; 
}
</style>
</head>
<body>
<p id="myP" 
   style="text-decoration:underline; cursor:hand;"
   onclick="function1()">
Render this text using the myC class</p>
</body>
</html>

    
      
      
Related examples in the same category
1.  'className' Syntax and Note
2.  'className' is applied to
























Home| Contact Us
Copyright 2003 - 04 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.