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

java - Cast from Object to List<String>: CastClassException -

How to set a border for android Imageview in Longpress? -

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