Reputation: 11
I have a I frame and inside the iframe is another website. I want to trigger the button of login to my external button
Upvotes: 0
Views: 165
Reputation: 513
If it's from another site/domain, you can't do it, it has to be on the same domain. To access elements within the iframe on the same domain you could use the frames property of the window object
let iframeBtn = window.frames['yourIFrame'].document.getElementById('buttonId');
//code to trigger the button inside the iframe
Upvotes: 3