[Javascript] ie and setAttribute('readonly')

Hassan Schroeder hassan at webtuitive.com
Mon Sep 3 14:00:59 CDT 2007


John Pillion wrote:

> how can you set a input/textbox to readonly *in IE*?  I tried the 
> setAttribute, and it doesn't seem to work for IE (while it does for 
> ff/ns). 

This seems to work in both IE7 and FF2 (minimal testing!) --

   document.getElementById("foo").readOnly = true;

HTH,
-- 
Hassan Schroeder ----------------------------- hassan at webtuitive.com
Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com

                            dream.  code.




More information about the Javascript mailing list