jquery - Javascript if statement is false, but the code is being executed -


i have following global variable declared on in script:

var ddfinished = 0; 

this if statement should false, reason, it's executed if it's true:

$(this).click(function(){             if (ddfinished = 3){                 $(this).find('.dd_chosen_answer').remove();                 $(this).removeclass("dd_question_dropped");                 $(this).droppable( "enable" );             }             else {                 $(this).droppable( "disable" );             } }); 

is there wrong syntax here? goal give myself variable can use toggle whether or not element become droppable on click.

in theory (my theory), should work, if executed, event though shouldn't according circumstance. variable ddfinished isn't declared or changed anywhere else on script currently.

it should be

if(ddfinished === 3) 

Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -