Adding an Event Handler


#1

$(document).ready(function(){
$('div').to Click(function(){
$(this).fadeOut('fast');
});
});

stuck here


#2

@matesh77,

Have a close look at

$('div').to Click(function(){


#3

$(document).ready(function(){
$('div').Click(function(){
$(this).fadeOut('fast');
});
});

You should type ".Click( )" instead of ".to Click".


#4

click should also be lower case.

$(document).ready(function(){
$('div').click(function(){
$(this).fadeOut('fast');
});
});


#5

where is the mistake?

$(document).ready(function){
$('div').click(function){
$ (this).fadeOut('fast');
});
});


#6

i don't understand either ? where is the mistake ?

$(document).ready(function){
$('div').click(function){
$ (this).fadeOut('fast');
});
});


#7

There is a whitespace between $ and (this):

Try out:
$(document).ready(function){
$('div').click(function){
$(this).fadeOut('fast');
});
});


#8

So within your code you need a space between your parenthesis and curly brackets for both lines like so, I tested your code and it works now. Hopefully that helps some, sometimes the best option is to see the answer and then go from there.

$(document).ready(function() {
$('div').click(function() {
$(this).fadeOut('fast');
});
});


#9

$(document).ready(function() {
  $('div').click(function() {
   $ (this).fadeOut('fast');
   });
});

This works for me I hope it will for ya'll!


#10

@@microjumper41661

you lack ( after the function. and
also remove the whitespace in your 3rd line after $


@aggelosqq

youve removed the whitespace but you still lack ( after the function


#11