Is there a way to load only images and iframes, similar to the .load() function? I want to automatically add a selector element into the "this" variable for this purpose.
$('document').ready(function({
$('a').<Something to trigger the code below on page load>(function(){
// Placeholder is used to temporarily store the href attribute so that the link does not navigate to another webpage.
$(this).attr('placeholder',$(this).attr('href'));
$(this).attr('href','javascript:');
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<a href="www.example.com">My Link</a>