document.forms[formName].elemName

T

Thomas 'PointedEars' Lahn

Gregor said:
Thomas 'PointedEars' Lahn meinte:
You're right. And the moon consists of green cheese. [psf 4.17]

I'm not a hundred percent positive about the "green". But "cheese" -
yes: Wallace and Gromit verified that [1].

D'oh, seems I'll have to update that psf :)


Regards,

PointedEars
 
T

Thomas 'PointedEars' Lahn

Stanimir said:
Sun, 25 May 2008 21:50:22 -0700 (PDT), /VK/:

Doesn't seem standards-compliant as the 'type' attribute of
HTMLButtonElement objects is defined to be read-only.

One wonders, though, why that is, given that the `type' attribute of HTML
4.01/XHTML 1.0 BUTTON/button elements may assume one of three possible values:

http://www.w3.org/TR/1999/REC-html401-19991224/interact/forms.html#edef-BUTTON
http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-strict.dtd

Seems like an obvious error in the DOM 2 HTML Specification to me.


PointedEars
 
S

Stanimir Stamenkov

Mon, 26 May 2008 10:43:00 +0200, /Thomas 'PointedEars' Lahn/:
One wonders, though, why that is, given that the `type' attribute of HTML
4.01/XHTML 1.0 BUTTON/button elements may assume one of three possible values:

http://www.w3.org/TR/1999/REC-html401-19991224/interact/forms.html#edef-BUTTON
http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-strict.dtd

Seems like an obvious error in the DOM 2 HTML Specification to me.

The 'type' attribute of HTMLInputElement has been read-only in the
DOM Level 1 but changed in DOM Level 2. As to why the 'type'
attribute of HTMLButtonElement was left read-only in DOM Level 2 I
could only speculate it is because that's how it is implemented in
Internet Explorer:

http://msdn.microsoft.com/en-us/library/ms534696(VS.85).aspx

Seems one could use instead:

var btn = document.createElement('button');
btn.setAttribute('type', 'reset');
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,127
Latest member
CyberDefense
Top