i'm looking for a way to set a variable as a property (for an element same as a div)
here is the code:
function set_it(element,property){
return element.style.property;
}
console.log(set_it(document.getElementById("div1"),"left"));
at last line i'm trying to get "left" property of "div1" by the function
but I get undefined in console
I know , actually it will look for a property named "property" , which doesn't exist
but how can I do this ?
thanks