[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

How can I autoclick a button on webpage with a javascript? Text

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 7
Thread images: 1

File: mättö-assad3.jpg (150KB, 1368x1026px) Image search: [Google]
mättö-assad3.jpg
150KB, 1368x1026px
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
Thread posts: 7
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.