here the element name and attributes will be passed to the function as shown below.
window['o' + elementname].setAttribute(atr, attr1);
e. window[atr]= attr1 }
here window['o' + elementname] is the element to which the attributes needs to be set.
atr is the name of attribute and attr1 is the value. To create an attribute dynamically which is in bold as shown in the code above.
here instead of giving
e. style.width= attr1
i want to write
e.'the variable name'=attr1
in both methods that i mentioned in my code null value error occurred.
how to achieve this?