Reputation: 672
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
Reputation: 2972
The id is kirimKritik, but in your JS you're writing "#kirimKririk".
Upvotes: 3
Reputation: 4100
kirimKritik != kirimKririk so it'll never find it because they don't match.
Upvotes: 3
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