JSFiddle - React, Tailwind, and code Playground

Simple example testing behavior of a random unknown attribute, versus the hidden attribute (which is a boolean in HTML5).

by kfranqueiro

HTML

<div id="one" baz="true" hidden="true">one (hidden="true")</div>
<div id="two" baz="false" hidden="false">two (hidden="false", doesn't make sense in HTML5)</div>
<div id="three" baz="false">three (hidden not set, considered false in HTML5)</div>

JavaScript

dojo.ready(function() {
    dojo.forEach(['one', 'two', 'three'], function(id) {
        dojo.forEach(['baz', 'hidden'], function(attr) {
            var v = dojo.attr(id, attr);
            console.log(id + ' ' + attr + ': ',
                v, '(' + typeof v + ')');
        });
    });
});