Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js code to take value from form and store it in a variable

function myfunction(){
  var element=document.getElementById("myformname").value;
  //what this statement does is it stores the value stored in the id myformname and the value is what was inputted by the user. 
  //similarly different ids can be used on form elements to store the different values that we receive in the form by the user.
}}
 
PREVIOUS NEXT
Tagged: #js #code #form #store #variable
ADD COMMENT
Topic
Name
6+2 =