How to change inline property value?

15 views
Skip to first unread message

Ben Stover

unread,
Nov 28, 2015, 6:56:04 AM11/28/15
to Greasemonkey Users
Assume I have the following HTML code of the original web page:

....
<h3 id="someid" ...... sectionselected="true" ....>....</h3>
.....

How do I switch the value from "true" to "false"?

Ben



Méhész György Ákos

unread,
Nov 28, 2015, 10:22:45 AM11/28/15
to greasemon...@googlegroups.com
Hi,

Use the setAttribute method.  e.g. document.getElementById("someid").setAttribute("sectionselected", false);
https://developer.mozilla.org/en-US/docs/Web/API/Element/setAttribute

Regards,
Akos


Ben



--
You received this message because you are subscribed to the Google Groups "greasemonkey-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to greasemonkey-us...@googlegroups.com.
To post to this group, send email to greasemon...@googlegroups.com.
Visit this group at http://groups.google.com/group/greasemonkey-users.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages