azraelGG Posted January 10, 2013 Share Posted January 10, 2013 (edited) i need check in condition did someone click button or didnt this button is used to display some jQuery and now i want different things to be loaded depending on is it clicked or not - page cant be refreshed that will lead in problem that i need click 2 times on that button <input id="popup" name="popup" type="submit" value="ADD" /> Edited January 10, 2013 by azraelGG Quote Link to comment Share on other sites More sharing options...
Langstra Posted January 10, 2013 Share Posted January 10, 2013 Include the jquery library and do it like this: $(document).ready() { if($("#popup").click(function() { //do something }); } Quote Link to comment Share on other sites More sharing options...
haku Posted January 11, 2013 Share Posted January 11, 2013 That needs one more line of code: $(document).ready() { if($("#popup").click(function() { //do something return false; }); } Or: $(document).ready() { if($("#popup").click(function(event) { event.preventDefault(); //do something }); } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.