javascript - jquery executes declared function without me clicking -


I do not know why the browser has clicked on the link without clicking on the "clicked links". This displays it whenever I refresh the page.

  & lt; Script type = "text / javascript" & gt; $ (Document) .ready (function () {function login () {alert ("logged in")}} $ ("# click here"). Click (login);}); & Lt; / Script & gt;  

I want to display it while clicking on the link.

What is the problem?

You must remove () after entering the JQuerys click () function.

  & lt; Script type = "text / javascript" & gt; $ (Document) .ready (function () {function login () {alert ("logged in");} $ ("# click here"). Click (login);}); & Lt; / Script & gt;  

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

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

php - jQuery AJAX Post not working -