I have this select:
<select id="987_country">
but I only know that the id ends with "country".
How I reference it (987_country) using:
$('#myIdName ')
I have this select:
<select id="987_country">
but I only know that the id ends with "country".
How I reference it (987_country) using:
$('#myIdName ')
Try with attributeEndsWith selector that
Selects elements that have the specified attribute with a value ending exactly with a given string. The comparison is case sensitive.
$('[id$=country]')
console.log($('[id$=country]')[0].nodeName)
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<select id="987_country"></select>