Jquery, Javascript click && value -


how check inside jquery if button clicked , if variable test has integer of 1? have done far.

$(".bx-next").click(function() && (test == 1){     $("#step_1").text("hello world!"); }); 

you're thinking click wrong. means "when button clicked". isn't condition testing @ time code runs. setting event handler run later.

so need rethink test:

if button clicked , if variable test has integer of 1?

should be:

when button clicked, if test 1.

$(".bx-next").click(function() {     if (test == 1) {         $("#step_1").text("hello world!");     } }); 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -