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

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -