Currently I've got a website with an iframe
loaded from another site into my website. The loaded iframed site requires a button, which has an id called 'accept', to be clicked. (cookies)
Of course the user should not click this button twice, so I want to click this button automatically once MY page is loaded.
Problem:
The loaded iframe
from the other site has no ID neither NAME tag.
How can I click this button on page load?
Code which I've tried, but does not work:
<script type="text/javascript">
$(document).ready(function(){
$("#accept").click();
});
</script>
I've readed on the internet it's possible to listen to an iframe
without an ID. But I have no clue on how to write this into code.
I've been searching google the whole day. I can't get a solution.
Hopefully someone can help me on my encountered problem. A fixed code with explaination/documentation would do it for me.
Best regards.