Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to make a
  • when clicked on a button js
  • function AddLi(str)
    {
        var li = document.createElement('li');
        li.appendChild(document.createTextNode(str))
        li.innerHTML += ' <button onclick="this.parentNode.remove()">-</button>';
        document.getElementById("out").appendChild(li);
    }
    Source by stackoverflow.com #
     
    PREVIOUS NEXT
    Tagged: #clicked #button #js
    ADD COMMENT
    Topic
    Name
    1+1 =