I have one textbox#search_text. on keyup i create one div#sresult_container.and append to some div to div#sresult_container. i try to bind click and mouseover event to div#sresult_container when this container display on canvas. i try following code but that not work.How can i do?
$("#search_text").keyup(function(e) {
if (e.which != 40 && e.which != 38) {
$("#search").removeAttr('disabled');
$.post('http://www.allinone.com', {
Search: sVal
}, function(data) {
$sresult_container = $('<div id="sresult_container"></div>');
//somecode which create another divs and append to the $sresult_container
})
}
$('#sresult_container').bind({
click: function(e) {
//some code
},
mouseover: function(e) {
//some code
}
});
});
you can do this task with “live” function.