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
Post a Comment