can someone fix this one for me ? it is made with jquery but can someone fix it without it ?
<script>
$(document).ready(function(){
$('.content').click(function(){
$('.content').toggleClass("heart-active")
$('.text').toggleClass("heart-active")
$('.numb').toggleClass("heart-active")
$('.heart').toggleClass("heart-active")
});
});
</script>
5 Replies
Is this still for your take home assignment, or are you just doing it for practice?
practice
And you're not using a framework? Vanilla html, css, and js?
all you have to do to replace jquery with vanilla in this case is put this at the bottom of the page, strip out the $(document).ready wrapper, and replace
with
toggleClass(...)
becomes classList.toggle(...)
And .click(function)
becomes .addEventHandler('click', function)
no
@jochemm thanks mate i fixed it