JSFiddle - React, Tailwind, and code Playground

by lollero

HTML

<div ></div>
<a href="#"></div>

JavaScript

var otext = 'alt',
    obj = $('div'),
    link_element = $('a');


if ( otext == null ) {

    $('body').text( "It's alive!" );
    
}
else if ( !link_element.attr( "title" ) || !obj.attr( "alt" ) ) {

    $('body').text( "Dead...." );

}