Struggling with a problem that seems like it must have an incredibly simple solution, but I can't figure out what I am doing wrong.
Scenario: I have three div's of class .subblock. One has an input(text) inside, the other two have a select.
Goal: When clicked on .subblock (div), focus on the input or select in it.
Code (that doesn't work for the selects):
HTML
<div id="homeinputs">
<form action="/listings/" method="GET">
<div class="subblock" style="border-radius: 4px 0px 0px 4px;">
<span>Where</span>
<input id="autocomplete" name="location" type="text" placeholder="Location">
</div>
<div class="subblock" style="margin-left: -4px; margin-right: -4px;">
<span>M<sup>2</sup></span>
<select name="squarems">
<option>All</option>
<option>+10m<sup>2</sup></option>
<option>+15m<sup>2</sup></option>
<option>+20m<sup>2</sup></option>
<option>+25m<sup>2</sup></option>
<option>+30m<sup>2</sup></option>
</select>
</div>
<div class="subblock" style="border-radius: 0px 4px 4px 0px; box-shadow: 0px 1px 2px lightgrey;">
<span>Price (€)</span>
<select name="pricings">
<option>All</option>
<option>450max.</option>
<option>500max.</option>
<option>550max.</option>
<option>600max.</option>
</select>
</div>
</div>
JS
$(document).ready( function() {
$('.subblock').click( function() {
$(this).find('input').focus();
});
$('.subblock').click( function() {
$(this).find('select').focus();
});
});