JSFiddle - React, Tailwind, and code Playground

HTML

<div>
    <label for="txtcolor">Select a color:</label>
    <select>
        <option value="black">Black</option>
        <option value="blue">Blue</option>
        <option value="red">Red</option>
    </select>
    <br />
    <span>Text With a color</span>
    <br />
    <a href="#" id="getcolor">Get text color</a>
</div>

JavaScript

$(function() {
    $('select').change(function() {
        $('span').css('color', $(this).val());
    });
    $('#getcolor').click(function() {
        alert('Color is: ' + $('span').css('color'));
    });
});