Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get element from iframe and click it

I wanne get an element from an iFrame and click it. Getting the element succeeded. Unfortunately i cant get the element within the iframe clicked. Anyone with a solution?

Thanks!

<script>
$(document).ready(function(){
var frame = $('#f314dbebb8'); //ID from the frame
console.log(frame);
});
</script>
like image 426
Donny van V Avatar asked Jan 03 '14 19:01

Donny van V


1 Answers

Is this what you are trying with

document.getElementById('iframeResult').contentWindow.document.getElementById('buttonId').click()

where iframeResult is Id of iframe and buttonId is Id of element to be clicked ??

like image 84
Piyush Ashtt Avatar answered Oct 13 '22 19:10

Piyush Ashtt