I have an input type=’text’, and using jQuery, every time this textbox is blurred out, I apply css(‘background’, ‘red’) to the textbox. The problem is, when I try to debug the code by puttin alert('test') and I click OK on the dialog, the same dialog with “test” keeps popping up.
Is this just due to the fact that clicking on OK is considered a blur out of the text box or is it something more serious?
Thanks in advance.
$('#input').blur(function(){
$(this).css('background','red');
alert('test');
}
You should debug with the console instead of alerts:
I believe in most browsers hitting F12 will bring up the console.