2
I manipulate the iframe DOM as follows: (http://api.jquery.com/contents/)
$('iframe').contents().find('a').função();
We usually use the preventDefault function like this:
$( "a" ).click(function( event ) {
event.preventDefault();
});
Doubt:
How to use the function preventDefault()
in an event click for all link tags $('a')
within iframe? Basically I need no link to be clickable inside iframe.
I’ve tested it as follows, but it doesn’t work:
$('iframe').contents().find('a').click(function (e) {
e.preventDefault();
});
I think you can mark one of the answers as right :)
– Sergio