Using the document.forms Property : Form HTML : Form Control JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Form Control » Form HTML »

 

Using the document.forms Property



<HTML>
<HEAD>
<TITLE>document.forms example</TITLE>
<SCRIPT LANGUAGE="JavaScript">
function myFunction() {
    if (document.forms[0].bluish.checked) {
        alert("Now going to the Blues music area...")
    else {
        alert("Now going to Rock music area...")
    }
}
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="theBlues">
<INPUT TYPE="checkbox" NAME="bluish">Check here if you've got the blues.
</FORM>
Text<HR>Text<HR>Text<HR>Text<HR>Text<HR>Text<HR>Text<HR>Text<HR>
<FORM NAME="visit">
<INPUT TYPE="button" VALUE="Visit music site" onClick="myFunction()">
</FORM>
</BODY>
</HTML>

           
       



-

Leave a Comment / Note


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

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Form Control
» Form HTML