问题
I'm jQuery beginner. I'm trying to modify the source code of a page I'm browsing, using Firefox plus Greasemonkey.
How can I modify:
<input id="HiddenCategory" type="hidden" name="PageCategory"></input>
to:
<input id="HiddenCategory" type="text" name="PageCategory" value="OTHER"></input>
?
回答1:
Something like this?
$("#HiddenCategory").attr("type", "text").val("OTHER");
This is untested but i think it should work ok.
来源:https://stackoverflow.com/questions/19085007/how-to-change-a-browsed-pages-input