最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - jquery how to remove ui-state-focus - Stack Overflow

programmeradmin1浏览0评论

A use jquery and button used my style, but when i clicked on button style changed on ui-state-focus. I try remove jquery style

$("button").mousedown(function () {
      $('button').removeClass("ui-state-focus");
});

but it not worked. How to remove jquery style?

A use jquery and button used my style, but when i clicked on button style changed on ui-state-focus. I try remove jquery style

$("button").mousedown(function () {
      $('button').removeClass("ui-state-focus");
});

but it not worked. How to remove jquery style?

Share Improve this question asked Mar 12, 2013 at 11:16 NarNar 5501 gold badge9 silver badges23 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 4

I add removeClass in focus and worked for me.

$("button").focus(function () {
    $(this).removeClass("ui-state-focus");
});

You should use $(this) instead of $('button')

$("button").mousedown(function () {
      $(this).removeClass("ui-state-focus");
});
发布评论

评论列表(0)

  1. 暂无评论