简体   繁体   中英

How to change the value on a input in someone else page?

<div class="xCoord">
    <label for="xCoordInput">X:</label>
    <input value="" name="x" id="xCoordInput" class="text coordinates x ">
</div>

What I would like to do is to change this value ( xCoordInput ) on someone else website? This is a game and I don't know how I would change their website from my own website.

I like to autofill forms with a bookmarklet . I use them at work to fill out tedious forms when I am testing webpages. To build one create a bookmark and edit the url value of the bookmark to hold a javascript function object like this one.

javascript:(function(){ 
    var xCoord = document.getElementsByClassName("xCoord")[0];
    xCoord.getElementsByTagName("input")[0].value="whatever";  
})();

Nothing about doing this in principle is wrong or illegal unless you are using it to cheat or break the law.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM