Depends on the browser...
But in IE, you can set the attribute disabled to true on whatever elements
you want to.
This works on every element as of IE 5.5, and on earlier versions (IE 4 and
up),
it works on form elements (e.g. input, buttons etc).
/Robert
-----Original Message-----
From: wenjun deng [mailto:denwe02@c...]
Sent: den 21 september 2001 20:00
To: javascript
Subject: [javascript] how to achieve disabled effect in js
Do you have any idea on how to make some text disabled ? See, when you
open an IE browser, click "Edit", then you will see that "Cut", Copy",
and "Paste" are disabled. The disabled font pattern seems to be the
default on many occasions.
I want to achieve the same effect. At first, I made the font color of
disabled text lighter or darker than the color of the foreground text and
disabled any action. But it doesn't quite look like been disabled. Then I
changed the color of disabled text lighter than the background color. This
time, I can hardly see the text. The benchmark should be similar to what
IE does.
Is there any method or property in javascript that can do this?
Thank you for your help!
Have a nice weekend!
Wenjun