1
Good afternoon, when I click on a button opens a window.confirm obviously it has an OK and CANCEL, I wonder if there is a way for me to click on this OK button as soon as it opens with javascript?
HMTL
<a href="/excluir/recado/5735526/b3dd743495e9e826c7703b7f3d26a545" onclick="if(!confirm('Tem certeza que deseja excluir esse recado?')) return false;" class="btn-orkut">excluir<*a>
Javascript:
document.getElementsByTagName("a")[0].click();
Javascript works well, but by default it opens the confirm window, and in this I have to keep clicking OK I would like to know if there is this possibility of javascript to be clicking on OK. grateful
Grateful for the answer ! So I can only keep where I was. Thank you
– Santiago Moreira
I think, in this case, it is not so much a security issue, since whoever programmed the script to display the confirmation window could simply call the code from the "Yes" button directly if they wanted to. In fact, the need for security is until the opposite-- if the script keeps calling many such windows, the browser may even provide an option to block them.
– Pablo Almeida