Why in the following code the focusin
event handler isn't called ?
HTML:
<div id='wrapper'></div>
<div id='button'>Click Here</div>
<div id='output'></div>
JS:
$(function() {
$('input').live('focusin', function() {
$('#output').html('focusin'); // Why this not happens ?
});
$('#button').click(function() {
$('#button').hide();
build_inputs();
});
});
function build_inputs() {
var html = "<input type='text' /> \
<br /> \
<input type='text' />";
$('#wrapper').append(html);
$('#wrapper').fadeIn(500, function() {
$('input:first').focus();
});
}
CSS:
#wrapper {
display: none;
background: #aaa;
width: 170px;
padding: 20px;
}