JQuery Syntax

In JQuery, is there a way to write, "IF a Select Name Contains"?

I have the following:
var deduc = $('select[name="item_options[product_deductible]"]').val();

I would like to have:
var deduc = $('select[name="IF NAME CONTAINS - product_deductible"]').val();
Who is Participating?
Chris StanyonConnect With a Mentor Commented:
use the wildcard (*) character in the selector:


Open in new window

Obviously if you use this, it may match more than one element and only return the first, so consider that when you design your app.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.