javascript - jquery click question -


I have a problem.

This code is:

  $ ("# button"). Click (function (event) {$ ("# threads"). Html ("hi");});  

When I click on the button, the text "Hi" is shown in just 1 second. So it disappears, I want to always show it after clicking, How can I do this?

Try it out:

  $ ("#button"). Click (function (event) {event.preventDefault (); $ ("# threads") .html ("hi");});  

My guess is that the button is a [a href] tag or in the form that is causing the page to refresh.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -