1

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?

1
  • Typo in the selector or the ID. Commented Jul 7, 2011 at 0:26

4 Answers 4

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

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

Sign up to request clarification or add additional context in comments.

2 Comments

Damn, look's like my eyesight and concentration began to decline.. Thanks for the correction.. : )
@Rebel happens to everyone, I am notorious for using the class "." selector to style ids in my csss
3

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

1 Comment

Damn, look's like my eyesight and concentration began to decline.. Thanks for the correction.. : )
3

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

Comments

2

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

1 Comment

My bad, the id and selectors that I wrote is different.. Thank you for correcting.. Problem SOLVED..

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.