i want to build my own PROP function just like what Jquery does, but in pure Java script.
this is my code :
<input id="submitButton" type="submit" value="LOGIN">
function prop(el, dom, boolean) {
var convert = eval(dom);
el.convert = boolean;
console.log(convert);
}
var x = document.getElementById("submitButton");
prop(x, "disabled", true);
How to convert string into object property? I heard that eval will be useful? But why did i got the below error?
ReferenceError: disabled is not defined
what's wrong with my code?
el[dom], orel.setAttribute(dom,value)to manipulatepropertiesof anel.