Some of the attributes of a DOM object in IE are read-only.

The "type" attribute is one of these and so cannot be assigned to AFTER the
element is created.

JK

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of spinnach
Sent: Thursday, April 12, 2007 2:06 PM
To: [EMAIL PROTECTED]
Subject: [jQuery] dynamic creation of an button


anybody knows why the following fails in ie, but works ok in firefox?
$('<input>').attr({'type': 'button', 'id':'some-id', 'value': 'yes'})

when i remove the type hash attribute, it works:
$('<input type="button">').attr({'id':'some-id', 'value': 'yes'});

dennis.

Reply via email to