Removing 'disable' from checkbox fields?

8 views
Skip to first unread message

Ian Webb

unread,
Jan 8, 2008, 3:51:26 PM1/8/08
to greasemonkey-users
This is probably really simple, but I'm not sure how to do it. I have
a webpage with some HTML lines such as the following:

<input type=checkbox name='PERSON_ROLE_ID_273' value='Y'
checked disabled onClick='javascript:popWarning(this);'>

Note the 'disabled' - I want to remove that one word. I know how to
replace the whole checkbox element with something else; how do I just
rewrite the HTML on it to re-enable that checkbox? Is there a
particular part of the documentation I should take a closer look at?

Thanks,
Ian

Vectorspace

unread,
Jan 8, 2008, 3:55:14 PM1/8/08
to greasemon...@googlegroups.com

RodMcguire

unread,
Jan 8, 2008, 4:16:41 PM1/8/08
to greasemonkey-users
alternatively if you have a bunch of check-box nodes under the parent
node bound to PARENT, and you want to get rid off all the 'disables'
in them you could do

PARENT.innerHTML = PARENT.innerHTML.replace('disable', '');

but note, this removes the string 'disable' from all descendants of
PARENT whether they are in <input> nodes or elsewhere, unless you give
a fancy regex as the first arg to .replace.
Reply all
Reply to author
Forward
0 new messages