jQuery('#sbox-window').on('change', '#filter-by-site', function(){
console.log(jQuery(this).val());
console.log('change');
});
<div id="sbox-window">
<div id="sbox-content">
<p>
<select id="filter-by-site">
<option value="null">Filter cameras by site</option>
<option value="1">Site 1</option>
<option value="2">Site 2</option>
<option value="3">Site 3</option>
</select>
</p>
</div>
</div>
Nothing happens… With deprecated live() all works fine. Where is problem?
Actually this works.
Is it possible that you are attaching the event to “sbox-window” that is part of a Jquery Template or to some other means that generate the div dynamically?.
Depending on the implementation the “sbox-window” div doesn’t exist during the document, ready so you’ll nee to bubble up to a higher Dom-Object— worst case to the document… but I wouldn’t recommend that… This is also why “live” works.