JSFiddle - React, Tailwind, and code Playground

HTML

<label>This Text</label>

JavaScript

var label = $('label');
if (label.text() === 'This Text') {
    alert('hi');
}