Unit 3:Event: Click: Try it out


#1

Hi, im currently trying to do the event handler on Unit 3, but i cant seem to figure out any of the three event try it out sections:
I tried to run the click part as:

var main = function() {
  $(".btn").click(function() {

		$(this).toggleClass("btn-like");
};

$(document).ready(main);

Im really confused how to solve all 3. I tried to look at the other posts but still cant figure it out.
Would appreciate any help.
Thanks in advance,
Khurem


#2

Hi Ksali25,

Please post a link to the exercise you're on so we can help you :slight_smile:


#3

Hi, its course located at:
https://www.codecademy.com/en/skills/make-an-interactive-website/topics/jquery-events/jquery-click-try

Thanks in advance
K


#4

OK, so you've forgotten to close the $(".btn").click(...); part. Before the closing curly brace (}) for the main function, add this:

});

:slight_smile:


#5

talk about obvious :smiley: thanks so much its been driving me crazy. Many thanks


#6

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.