-1
I have a img
within a a
and I want to remove the image, but I can’t. I’m using jQuery.
HTML:
<a href="https://api.whatsapp.com/send?phone=55" class="whats-footer" target="_blank"><img src="imagens/whats.png" class="img-js" alt=""></a>
JAVASCRIPT:
<script type="text/javascript">
$(window).scroll(function() {
if ($(this).scrollTop() > 50) {
$('a').removeClass('whats-footer');
$('a').removeAttr('img');
}
});
</script>
opa, thanks. I started a little while ago in this branch of javascript and started messing with jquery too... so I don’t know much about this kkk
– user153248
@Felipemoreira No problem my dear, an important tip that I will give you is to study soon about the selectors, to understand
'a > img'
works and how it works. Not much are the selectors, and you will need it straight. so study soon this part that will help you in everything!– hugocsl