wahyueka31
wahyueka31

Reputation: 672

Jquery event onclick won't work

I have a jquery click function like this :

$( "#kirimKririk" ).click(function() {
            alert("test klik");   
});

and this function provides event onclick on this html tag :

<input type="button" value="Kirim Komentar" id="kirimKritik"/> 

Unfortunately that click function does not work at all..

I've checked the html tags on that page, moreover I use the application TagCheck HTML/XML to check html tags, and no error messages.

Anyone can give suggestions what else should I check?

Upvotes: 1

Views: 205

Answers (4)

Dinash
Dinash

Reputation: 3047

spelt... please check it... it is kirimKritik not kirimKririk

Upvotes: 2

Philip Ramirez
Philip Ramirez

Reputation: 2972

The id is kirimKritik, but in your JS you're writing "#kirimKririk".

Upvotes: 3

Michael
Michael

Reputation: 4100

kirimKritik != kirimKririk so it'll never find it because they don't match.

Upvotes: 3

Kevin Bowersox
Kevin Bowersox

Reputation: 94499

$( "#kirimKritik" ).click(function() {
            alert("test klik");   
});

The id and selector didn't match. You had a spelling error in the selector.

Upvotes: 4

Related Questions