JSFiddle - React, Tailwind, and code Playground

by David Thomas

HTML

<div data-go-to="twelve"></div>
<div data-go-to=""></div>
<div data-go-to="9"></div>
<div data-go-to="1"></div>
<div></div>

CSS

div {
    height: 2em;
    border-bottom: 2px solid #000;
    background-color: #ffa;
}
div:nth-child(odd) {
    background-color: #f90;
}
div::after {
    content: " (" attr(data-go-to) ")";
    float: right;
}

JavaScript

$('[data-go-to]').filter(
    function(){
        return ($(this).attr('data-go-to').length > 0);
    }).text('a non-empty "data-go-to" attribute');