On Feb 13, 6:41 pm, wwwiori <[EMAIL PROTECTED]> wrote:
> Thank you for your reply. And I have testing on IE7 and
> Firefox2.0.x  , and when I using code:
> document.getElementById("changeType").setAttribute("type","button");
>  can change the type when the element has created... so,I think maybe
> IE and Firefox can support on the change when the element has
> created.  Do you think so ?

No. In both IE6 and IE7, an input element's type is immutable once
it's been set. Why? My guess is that these elements are not
implemented
by the browser, but are instead native Windows controls, which don't
support this mutability. And, apparently, the IE designers didn't want
to replace such an object with another just because its type had
changed
(think copying all attributes and event handlers).

But that's just a guess; in any event, if you really *must* change an
input's type, your only cross-browser solution is what andrea varnier
suggested; but that leaves the responsibility of duplicating ID,
classes,
style, hooked events, etc. to *you*.

--

hj

Reply via email to