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

Is there an open source WebSockets (JavaScript) XMPP library? -

java - Is there an object like a "Set" that can contain only unique string values, but also contain a count on the number of occurrences of the string value? -

mysql - Can mysql_pconnect be called multiple times in one php page? -