On click load iframe
I have this html
a href=#1647278006925-e8321147-313b data-vc-accordion= data-vc-container=.vc_tta-containerspan class=vc_tta-title-textLISTEN/span/a
that is printed in my page and opens an accordion with an iframe in it. The iframe:
iframe id=myiFrame class=stop-lazy data-src=https://some.iframe frameborder=0 allowtransparency=true style=width: 100%;min-height: 150px;/iframe
I am trying to create a jquery code that will load the iframe only when the user click on the link. So i have tried to set the below script in the footer.php:
script $(.vc_tta-title-text).click(function(){ var iframe = $(#myiFrame); iframe.attr(src, iframe.data(src)); }); /script
but it is not working.
Any help would be appreciated.
(Note:It would be better to trigger the click event from the href=#1647278006925-e8321147-313b )
*I can not edit the html.
**I can edit, add or remove classes or ids in the iframe.