topical media & game development

talk show tell print

#javascript-code-19-getattribute.js / js



  // Find all the form input elements
  var input = document.getElementsByTagName(“input”);
  for ( var i = 0; i < input.length; i++ ) {
  
      // Find the element that has a name of “text”
      if ( input[i].getAttribute(“name”) == “text” ) {
  
          // Copy the value into another element
          document.getElementById(“preview”).innerHTML = 
              input[i].getAttribute(“value”);
  
      }
  
  }
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.