Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

remove list content js

function removeListItemByText(text) {
  const li = [...document.querySelectorAll("li")];
  li.forEach(elem => {
    if (elem.innerText == text) elem.parentNode.removeChild(elem);
  });
}

document.getElementById("button").onclick = function() {
  removeListItemByText("FA");
};
Comment

PREVIOUS NEXT
Code Example
Javascript :: url in js 
Javascript :: how to change the choose file button text in react 
Javascript :: File type node js 
Javascript :: search substring in string javascript 
Javascript :: btn.addeventlistener 
Javascript :: __dirname is not defined 
Javascript :: convert model object to json django 
Javascript :: alpine in laravel mix 
Javascript :: javascript validate password 
Javascript :: getboundingclientrect() javascript 
Javascript :: append object to object javascript 
Javascript :: how to check if an object is map in javascript 
Javascript :: current date minus days javascript 
Javascript :: string to array javascript 
Javascript :: NameError: uninitialized constant Shoulda 
Javascript :: nice react native shadow 
Javascript :: javascript check if variable is number 
Javascript :: json array to string in postgresql 
Javascript :: node version check in cmd 
Javascript :: javascript convert character to ascii 
Javascript :: async react setstate 
Javascript :: how to remove duplicate values in array of objects using javascript 
Javascript :: jquery reload iframe 
Javascript :: react check if mobile or desktop 
Javascript :: for loop on a array 
Javascript :: owl-carousel only for mobile 
Javascript :: reload page angular one time 
Javascript :: loop through array backwards 
Javascript :: render tab screen when goBack function is called of other screen 
Javascript :: react native load function each time visit screen 
ADD CONTENT
Topic
Content
Source link
Name
3+5 =