I manipulate the iframe's DOM as follows: ( link )
$('iframe').contents().find('a').função();
We usually use the preventDefault function like this:
$( "a" ).click(function( event ) {
event.preventDefault();
});
Doubt:
How do I use the preventDefault()
function in a click event for all the $('a')
link tags within the iframe? Basically I need no links to be clicked inside the iframe.
I've tested it this way, but it does not work:
$('iframe').contents().find('a').click(function (e) {
e.preventDefault();
});