JSFiddle - React, Tailwind, and code Playground

HTML

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/ui-lightness/jquery-ui.css">
<select id='id'>
    <option>$987.23</option>
    <option>$123.45</option>
    <option>$234.56</option>
</select>

JavaScript

$("#id").change(function() {
    
    var product = $("#id :selected");         // This is a dropdown
    var prodTxt = product.text();             // Returns string as expected
    var price = prodTxt.match(/\$[0-9]{3}/);  // Commenting this out removes the error. 
    //var price = prodTxt.match(/\$[0-9]*/);
    $('body').append('<br/>' + price[0]);
});