So I'm trying to make a chrome extension for a forum and right now I'm stuck at the necessary confirm after pressing the delete-button.
I want to press the confirm-button but as far as I understand I have to find it first - for this I have the content-script. But now I dont know how to find the right element, I just dont know how to identify the button.
This is the Code on the Webpage:
<td class="confirmButtons">
<form action="modcp.php" method="post">
<input class="formAction" type="hidden" name="" value="">
<ul>
<li class="button"><a href="javascript:void(0);" class="formAction" rel="confirm" tabindex="2"><strong>Ja</strong></a></li>
</ul>
<ul class="buttonGroup">
<li class="first"></li>
<li class="button"><a href="javascript:void(0);" class="formAction" rel="cancel" tabindex="2"><strong>Nein</strong></a></li><a href="javascript:void(0);" class="formAction" rel="cancel" tabindex="2">
<li class="last"></li>
</a></ul><a href="javascript:void(0);" class="formAction" rel="cancel" tabindex="2">
</a></form></td>
The Code I have in the content_script so far:
function clickJa() {
var confirmButtoon = document.getElementsByClass("form-action");
confirmButton.click();
}
clickJa();
I know this doesnt work but I dont know what do do...
Thanks for every piece of help, greetings =)