@cali_green
To use jQuery click inside an iframe on the same domain, you can follow these steps:
- Add jQuery library to your parent page and iframe page (if not already added).
- In the parent page, you can target the iframe element using its id or class and use the .contents() method to access its content. For example:
1
2
3
|
$('#iframe-id').contents().find('button').click(function(){
// Your click event code here
});
|
- Make sure that the iframe source url is on the same domain as the parent page. Otherwise, you may run into cross-origin restrictions.
- In the iframe page, you can also use jQuery to trigger a click event from the parent page. For example:
1
|
parent.$('button').click();
|
By following these steps, you can easily use jQuery click inside an iframe on the same domain.