converting string into Boolean value using JavaScript always give false -


i using code below in javascript change string on site boolean value using javascript. when alert test says true, when alter name bool see flase ideas why case.

var test = document.getelementbyid("name").value; var namebool= (string == test); 

compare string value expect have when should represent true value:

var namebool = test === "true"; 

Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -