开发者

Hide and remove class on blur

开发者 https://www.devze.com 2023-04-09 05:27 出处:网络
See this: http://jsfiddle.net开发者_JAVA百科/AFhvS/4/ Try remove the text inside the input field in one of the two filled fields: http://jsfiddle.net/AFhvS/5/ and then go on blur, it should appear a

See this: http://jsfiddle.net开发者_JAVA百科/AFhvS/4/

Try remove the text inside the input field in one of the two filled fields: http://jsfiddle.net/AFhvS/5/ and then go on blur, it should appear a alert, but it doesnt, so i have done something wrong?


you may add the class you want to remove

$('.upstartRemoveClass').removeClass("upstartRemoveClass");

You may also want to look into when you tab between items, at the moment you are using the click event on the tr, maybe you want to use the focus event on your inputs instead?

edit: http://jsfiddle.net/AFhvS/7/ changed events on when things should trigger.


You've put the onBlur handler on the tr instead of on the input. That's why it's not firing.


This might work for you, or at least lead you in the right direction:

$('tr').removeClass('upstartRemoveClass');

or in your blur function:

$(this).removeClass('upstartRemoveClass');
0

精彩评论

暂无评论...
验证码 换一张
取 消