I have my JS code as below;
var editable = isNameEditable(this.get("status"));
return "<div class='editableTxt' name='myNameFld' data-editable=" + editable + "'">" + this.get("name") + "</div>";
The function isNameEditable just returns boolean value (true/false)
I then append it to my div using data-editable attribute.
I use the above value for comparision later and use below code;
if ($(this).attr('data-editable'))
However, the appended value becomes a string ("true"/"false") and hence the above condition does not work as expected.
Is there any way by which I can append a boolean value, so that I do not have to change my comparison i.e.
if ($(this).attr('data-editable'))