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

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

c# - Exception when attempting to modify Dictionary -