Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
所以我有这个代码:
function myOnFocus(){ $('tr').css("background-color","white"); $(this).parent().parent().css("background-color","blue"); } $(".priority").focus(myOnFocus());
我怎样才能用 jquery .focus() 事件调用 myOnFocus() 但又不写这两个括号之间的整个函数?
$(".priority").focus(myOnFocus);
使用()调用函数..
()
只需() 从
$(".priority").focus(myOnFocus());
到