'onChange' Example : onChange : Event onMethod JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Event onMethod » onChange »

 

'onChange' Example



    
<head>
<script language="JavaScript">
    function function2(colors) {
        var col = (colors.options[colors.selectedIndex].value);
        if (col) { 
           document.bgColor = col; 
        }
        alert("The background color has changed to "+col
    
</script></head>
<body>
<select name="colors" onChange="function2(this)">
    <option value="white" selected>White</option>
    <option value="cyan">Cyan</option>
    <option value="ivory">Ivory</option>
</select>
</body>

    
      
      



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Event onMethod
» onChange