Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js user add names to a list on screen

document.getElementById("add").onclick  = function() {

    var node = document.createElement("Li");
    var text = document.getElementById("user_input").value; 
    var textnode=document.createTextNode(text);
    node.appendChild(textnode);
    document.getElementById("list_item").appendChild(node);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #user #add #names #list #screen
ADD COMMENT
Topic
Name
4+6 =