I have an option list with an id that could sometimes be one of these:
edit-panes-billing-billing-zone
edit-panes-billing-billing-zone--1
edit-panes-billing-billing-zone--2
edit-panes-billing-billing-zone--3
edit-panes-billing-billing-zone--4
There is only one select element at a time.
Is it possible to select the option list dynamically with jQuery?
This is what I’ve tried, but it’s not working:
$("select[id^='edit-panes-billing-billing-zone--']").each(function() {
alert('test'):
}
You have a number of failing syntax errors in your code:
should be
And
should be
The final result should be:
This succeeds in all the tests I’ve run.