How do I Trigger the button of other website

I have a I frame and inside the iframe is another website. I want to trigger the button of login to my external button

enter image description here

Upvotes: 0

Views: 165

Answers (1)

Cesar Correchel
Cesar Correchel

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

Related Questions