Samuel Meddows
Samuel Meddows

Reputation: 36712

Executing Jquery POP up from a link

I have a script from jquery that executes a pop up from a button. I want to use a href link instead but can't figure out the syntax to do so. Going through the jQuery documentation I can't find anything specifying what I am try to do.

the link is:<a href="#" class="connect_link" id="create-user">Join the mailling List</a>

The current code i have is:$( "#create-user" ) .button() .click(function() { $( "#dialog-form" ).dialog( "open" ); }); I assumed that if you changed .button() to .link() it would work but no such luck.

Thanks guys.

Upvotes: 0

Views: 881

Answers (1)

kafuchau
kafuchau

Reputation: 5593

You should be able to do:

$( "#create-user" ).click(function() { $( "#dialog-form" ).dialog( "open" ); });

And it'll work. $("#create-user") selects your element, and then doing .click() binds the click action to that element.

Upvotes: 1

Related Questions