I am using jquery to write true and false strings to data- html attributes. However when I write false to one of the attributes, and then check it it false, it returns true. I a
Boolean('false') will return true because the string 'false' is truthy.
Boolean('false')
true
'false'
You could just run a check to see if the string equals 'false':
if ($(this).attr("data-is-panel-activated") === 'false') { ..... }