I have function:
$(document).ready(function(){
$("input.myclass").focus(function() {
// something
}).blur(function() {
// something
});
}
and html:
<div class="usil">
<div class="editable">
<form>
<input type="text" class="myclass" />
</form>
</div>
</div>
On load page jquery on “myclass” elements work fine but other script add dynamically “usil” class divs and on this divs jquery dont work. How to do it?
Use event delegation:
or
http://api.jquery.com/on
http://learn.jquery.com/events/event-delegation/