Answers for "add attribute to object js"

7

javascript add attribute

var element = document.getElementById('btnBuild');
element.setAttribute("disabled", "disabled");
Posted by: Guest on June-23-2021
2

Add New Properties to a JavaScript Object

var myDog = {
  "name": "Happy Coder",
  "legs": 4,
  "tails": 1,
  "friends": ["freeCodeCamp Campers"]
};

myDog.bark = "woof";
// or
myDog["bark"] = "woof";
Posted by: Guest on July-19-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language