admin管理员组

文章数量:1391960

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");
});

本文标签: javascriptjquery how to remove uistatefocusStack Overflow