JSFiddle - React, Tailwind, and code Playground

by hallettj

HTML

<div class="a"></div>
<div class="b"></div>

<ul id="log">
</ul>

JavaScript

function log(msg) {
    $('#log').append($('<li/>').text(msg));
}

var id = $('.a').attr('id', 'foo').get(0).id;
log(id);