Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

remove btn

function addTask() {
    var node = document.createElement("LI");
    node.textContent = document.getElementById("myTask").value;

    var btn = document.createElement("button");
    btn.textContent = "delete";
    btn.addEventListener('click', () => node.remove());
    node.appendChild(btn);

    document.getElementById("myList").appendChild(node);
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: window.open 
Javascript :: vuejs copy to clipboard 
Javascript :: can we get the value of form control after disabling it angular 
Javascript :: three dots in javascript 
Javascript :: switch case statement in javascript 
Javascript :: jquery parsexml get attribute 
Javascript :: click on browser.find_element_by_xpath with href 
Javascript :: find the height of space above element using javascript 
Javascript :: node load testing-check 
Javascript :: browser support 
Javascript :: text animation css and js 
Javascript :: password validation regex 
Javascript :: React ES6 Arrow Functions 
Javascript :: export default module 
Javascript :: clone canvas 
Javascript :: recursive function scheme 
Javascript :: ajaxstart not working in chrome 
Javascript :: repeat call n times in js 
Javascript :: javaScript getDate() Method 
Javascript :: discord.js find word inside comment 
Javascript :: beanstalk nodejs default port 
Javascript :: javascript variable as object key 
Javascript :: remote with post data jquery ajax example 
Javascript :: why .env file in node.js is not working to connect mongodb 
Javascript :: mdn .includes 
Javascript :: regex city and state 
Javascript :: div goind down 
Javascript :: obtain only integer not decimal js 
Javascript :: bogo sort js 
Javascript :: JavaScript switch With Multiple Case 
ADD CONTENT
Topic
Content
Source link
Name
7+8 =