JSFiddle - React, Tailwind, and code Playground

HTML

<label for='Name'>Name:</label> <input type=text name="Name"/>
<label for='PhoneNo'>Phone:</label> <input type=text name="PhoneNo"/>

JavaScript

$('input').blur(function() {
    $('label[for="'+$(this).attr('name')+'"]').css('color','red');
});