Answers for "add new attribute to object javascript"

7

javascript add attribute

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

how to add property to object in javascript

var data = {
    'PropertyA': 1,
    'PropertyB': 2,
    'PropertyC': 3
};

data["PropertyD"] = 4;

// dialog box with 4 in it
alert(data.PropertyD);
alert(data["PropertyD"]);
Posted by: Guest on April-16-2020

Code answers related to "add new attribute to object javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language