How would I combine two elements to use the focus function? #s_type and #s_ctry I’m trying to avoid extra code by retyping the same exact thing twice.
the way i’m trying it now doesn’t work.
<script type="text/javascript">
$(document).ready(function() {
$("#s_type", "#s_ctry").focus(function() {
var first = $(this).find("option").eq(0);
if(first.val() === "0") {
first.remove();
}
});
});
</script>
You have to use a comma in the selector itself:
Reference