Answers for "how to delete an attribute of an object in js"

0

delete attribute javascript

var target = document.getElementById("p12");
target.removeAttribute("class");
Posted by: Guest on May-29-2021
1

how to delete a property from a javascript object

var person = {
  firstName:"John",
  lastName:"Doe",
  age:50,
  eyeColor:"blue"
};

delete person.age;  // or delete person["age"];

// Before deletion: person.age = 50, after deletion, person.age = undefined
Posted by: Guest on May-24-2021

Code answers related to "how to delete an attribute of an object in js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language