I am trying to get the text "FOUND" by the Reg.Exp. to change color inside of a select menu, but not success, any better way to accomplish this:
<span style="padding-right:40px">
<select id="sel" name="sel">
<option value=""> Choose</option>
<script type="text/javascript">
$( document ).ready(function() {
var myRegExp = /toy/i; /* this text I am trying to change color */
var myText = 'This is a toy, from toys';
if( myRegExp.test(myText) ) {
myText.replace(/toy/ig, '<span class="green">$1</span>')
}
});
</script>
<option value="This is a toy, from toys" id="opt">
This is a toy, from toys
</option>
Thanks for looking!