Seeking help with jQuery and RegEx in JavaScript for selecting specific options in an HTML select list.
var ddl = $($get('<%= someddl.ClientID %>'));
Is there a way to utilize the .each() function for this task?
For Instance:
<select id="someddl">
<option value="21">[21] SomeData ***DATA***</option>
<option value="22">[22] SomeData ***DATA***</option>
<option value="23">[23] SomeData </option>
<option value="24">[24] SomeData </option>
<option value="25">[25] SomeData ***DATA***</option>
</select>
The goal is to style items 1, 2, and 5 from the provided example using CSS classes. Previously used RegEx in C#:
Regex expression = new Regex(@"\*\*\*");
, now looking for a solution in JavaScript which may require a modified regex pattern.
Would appreciate any insights or solutions to achieve this task effectively!
Thanks, ~ck