I\'m attempting to use attribute selectors and CSS for formatting elements.
The HTML looks like:
User Name
You are setting the attribute to JavaScript true and false, not string "true" and "false". This could be interpreted by the browser as 1 and 0 and lead to unwanted results.
true
false
"true"
"false"
1
0
Can you try
node.setAttribute('highlight', 'true');
?