1

I'm trying to select multiple select menus via jquery selector + regex, however, I keep getting unrecognized expression

Here is what I have tried

$(':regex(class,kt-trxselect-[0-9])');
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.0/jquery.min.js"></script>
<select class="form-control kt-trxselect-0">
    <option></option>
    <option>two</option>
    <option>three</option>
</select>


<select class="form-control kt-trxselect-1">
    <option></option>
    <option>two</option>
    <option>three</option>
</select>
Deano
  • 11,582
  • 18
  • 69
  • 119

1 Answers1

1

I believe regex support you talk of was only available via a custom jQuery Selector written in 2009.

I would recommend going with standard CSS "begins with" style selectors if you can.

Or perhaps adding an additional class kt-trxselect which would be easy to match on.

Dean Taylor
  • 40,514
  • 3
  • 31
  • 50