Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

add button to add item javascript


<script>
    function addItem(){
        var li = document.createElement("LI");  
        var input = document.getElementById("add");
        li.innerHTML = input.value;
        input.value = "";

        document.getElementById("faves").appendChild(li);
    }
</script>

<input type="button" id="btnAdd" value="Add" onclick="addItem()">

Source by coders911.org #
 
PREVIOUS NEXT
Tagged: #add #button #add #item #javascript
ADD COMMENT
Topic
Name
5+4 =