Reputation: 13
i have create an input box in java script like this: text.appendChild(document.createElement("input"));
i try to re-size with: text.size = '10';
but it is not working
Upvotes: 0
Views: 89
Reputation: 944321
size
is a property of the <input>
. You're trying to apply it to the container you put the input in.
You need to either keep a reference to the input (by assigning it to a variable instead of passing the return value of createElement
to appendChild
) or find a new one (e.g. through getElementsByTagName
) and set the size on that.
Upvotes: 2