0

By this code I can detect click inside iframe

 <script type="text/javascript">
   var detector = setInterval(function() {
     var elem = document.activeElement;
     if (elem && elem.tagName == 'IFRAME') 
     {
       alert("Click detected inside iframe.");
       clearInterval(detector);
     }
   }, 100);
 </script>

This is a button code that is inside Iframe.

<button type="button" class="btn btn-primary startpage-btn  pull- html-area" ng-if="currentNode.object.data.styles.button1Text" ng-stylez="getButtonStyle(currentNode.object, 'button1')" ng-bind-html="" ng-click="onButtonClick('button1')" compile="currentNode.object.data.styles.button1Text" compile-fields="fields" ng-hide="isButtonHidden()">Next</button>

Is there any way by which I can detect this button click with jquery?

Twisty
  • 30,304
  • 2
  • 26
  • 45
  • Welcome to Stack Overflow. Please provide a Minimal, Reproducible Example: https://stackoverflow.com/help/minimal-reproducible-example – Twisty Feb 04 '22 at 19:46
  • 1
    jQuery from _host_ window can't access to DOM in iframe. You can [_enter_ to the iframe's document](https://stackoverflow.com/a/7570527/5533907) and add the listener already there. – 7-zete-7 Feb 04 '22 at 20:04

0 Answers0