I cannot get a .change()
, .click()
, or .keydown()
trigger to work in any browser on my facebox form.
-- EDIT --- The problem is that facebox CLONES html to display it in the dialog box element. Because of this, jquery selectors work, but event triggers do not (based on the duplicate). The fix is to modify facebox and remove the .clone() behavior.
-- END EDIT --
The following works on document ready:
$('input#testE').css('background-color', 'red');
where #testE is a text input. On load the textbox background is red. however...
$('input#testE').keydown(function() {
$('input#testE').css('background-color', 'red');
});
does not trigger. I've also tried .change()
, and .click()
. Neither will it print to console for testing. My code works fine in jsFiddle, but will not work in my environment. Any thoughts on this?
edit....
to clarify on the document ready issue:
$(document).ready(function() { //on document load
console.log('test'); // this works
$('input#testE').keydown(function() { //won't fire
$('input#testE').css('background-color', 'red');
});
$('input#testE').css('background-color', 'blue'); //works
});