How can I autoclick a button on webpage with a javascript? Text of a button is always the same but it's oclick command is always different.
<div class="dialog" id="delete_65426234" style="background-color: rgb(255, 255, 238);"><h3>Delete message</h3><p>Are you sure you want to delete message?</p><button onclick="deleteMessage(65426234, true)">Delete</button><button class="right" onclick="closeDialog('#delete_65426234'); return false;">Cancel</button></div>
Here is the part I want to autoclick. Is there a way to search this element with document.getelementbyname? The problem is that ID is different every time. But this is always only result that starts with "delete_".
>>59822397
Elaborate. Do you control the webpage or do you mean using js in something like chrome extensions? Why are you autoclicking a button instead of just invoking functions? What functions do the buttons perform?
>>59822419
https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector
>>59822433
I want to delete all the messages I've posted on finnish imageboard with this script I have on my bookmarks.
I now have a script that "clicks" all the delete buttons. I still need to verify deleting these messages by clicking this button.
This is the code I have now:
javascript: var x = document.getElementsByClassName("icon-trash2"); for (var i = 1; i < x.length-1; i++) x[i].click();
>>59822397
Ask your wife's .json
>>59822480
Kekd