how to enter a random value in a textarea without an id?

前端 未结 3 1915
花落未央
花落未央 2021-01-24 17:33

I have to enter a random value in a textarea of a web site by using grease monkey script the text area didn\'t have an id so document.getElementB

3条回答
  •  无人共我
    2021-01-24 17:59

    Use getElementsByName:

    document.getElementsByName("inpx_msg")[0]
    

    Obviously, you'll have to check if it exists, etc.

提交回复
热议问题