1
I’m doing some tests and I came across this very boring mistake.
It’s easy to explain: I want Jquery to give the alert
in all the <a>
of the page, but it only alert
once and nothing more. Let’s go to the codes:
<ul>
<li> <a href='http://www.google.com' class='tooltip'> Não clique </a></li>
<li> <a href='http://www.youtube.com.br' class='tooltip'> Não clique </a></li>
<li> <a href='http://www.redtube.com.br' class='tooltip'> Não clique </a></li>
</ul>
Then I did Jquery, which is simple:
<script>
/*$(document).ready(function(e) {
var href = $('.tooltip').attr('href');
alert(href);
});*/
$(window).scroll(function(){
var href = $('.tooltip').attr('href');
alert(href);
})
</script>
tries to change jquery to
$('href').each(function(){var href = $('.tooltip').attr('href');
 alert(href);});
– alexandre9865