Answers for "add attribute in javascript object"

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 "add attribute in javascript object"

Code answers related to "Javascript"

Browse Popular Code Answers by Language