how to enter a random value in a textarea without an id?
问题 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.getElementById doesn't work. Can I use another method to do that? My current HTML showing my textarea : <tr> <td class="tdv pd5"><span class="tbg"> Message</span> </span> </td> <td class="pd5"> <textarea name="inpx_msg" class="msgbox"></textarea> <br /> <div class="tsm">140 characters max.</div> </td> </tr> 回答1: You could use element.querySelector if you want to