Answers for "avascript create list group dynamically onclick javacscript"

0

avascript create list group dynamically onclick javacscript

function addItem(){
    var ul = document.getElementById("dynamic-list");
    var candidate = document.getElementById("candidate");
    var li = document.createElement("li");
    li.setAttribute('id',candidate.value);
    li.appendChild(document.createTextNode(candidate.value));
    ul.appendChild(li);
}

function removeItem(){
    var ul = document.getElementById("dynamic-list");
    var candidate = document.getElementById("candidate");
    var item = document.getElementById(candidate.value);
    ul.removeChild(item);
}
Posted by: Guest on May-23-2020

Code answers related to "avascript create list group dynamically onclick javacscript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language