1. Get the value of a property in the form
var name = Document.myform.myname.value;
2, the form when the verification, the corresponding JS code needs to return TRUE or false
<form name= "MyForm" onsubmit= "return Checkform ()" method= "Get" >
</form>
3, the page display and does not display
Showing: style= "Display:block;" or style= "visibility:visible;"
Does not show: style= "Display:none;" or style= "Visibility:hidden;"
JS changes the style so that it displays: document.getElementById ("Myage"). style.visibility= "Visible";
4. Confirm Message Prompt Box confirm usage
<script type= "Text/javascript" > if(Confirm ("OK to hide age?") ")) { document.getElementById (" Myage "). style.visibility=" hidden "; } </script>
5, JS to button binding fixed-point event
var mybtn = document.getElementById ("mybtn"); Mybtn.onclick=function A () { alert ("aaaaaa");}
6, Radio dynamic display content
:
Code:
<! DOCTYPE html>
Plain JS Common code