I have the following dropdown list:
<select id="dropdown">
<option value="AB">Alberta Standards</option>
<option value="BC">British Columbia Standards</option>
</select>
Trying to Change Standards to Curriculum without Changing anything else.
This is what I have:
$('#dropdown option').filter(function() { return /Standards/.text($(this).text());}).text('Curriculum');
But this replaces everything to Curriculum! Any ideas?
Thanks,
Hiya working demo http://jsfiddle.net/fppeZ/ or http://jsfiddle.net/fppeZ/1/
Good read: http://www.regular-expressions.info/wordboundaries.html
HOpe this helps,
Jquery code