JSFiddle - React, Tailwind, and code Playground

by Matt Ball

HTML

<div id="foo" class="bar baz" style="margin-left: 2px; height: 10px;"></div>

JavaScript

// open your console

var foo = document.getElementById('foo'),
    attrs = foo.attributes,
    i = attrs.length,
    attr;

while (i--)
{
    attr = attrs[i];
    console.log(attr.name + '="' + attr.value + '"');
}