J
James Black
I am curious if there is a benefit to set attributes directly, in my
javascript, or to use setAttribute.
For example, I have this:
var input = document.createElementNS(xhtmlNS, 'input');
input.setAttribute('width', '20em');
I could have just called input.width='20em'
When is each better to use, or is there no difference between them?
Thank you for any help.
javascript, or to use setAttribute.
For example, I have this:
var input = document.createElementNS(xhtmlNS, 'input');
input.setAttribute('width', '20em');
I could have just called input.width='20em'
When is each better to use, or is there no difference between them?
Thank you for any help.