I am trying to retrieve a data attribute of type Boolean from an html DIV element , however it is always returning false when the string is converted to boolean .
H
"true" is internally casted to boolean (try alert (typeof(isreturn_str))), hence your === comparison fails on type check.
"true"
alert (typeof(isreturn_str))
===
You could call .toString()
.toString()
isreturn_str = $('#test').data('return').toString();
http://jsfiddle.net/494wC/8/