How to change a browsed page's <input>?

折月煮酒 提交于 2019-12-13 19:49:10

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!