Sunday, April 28, 2024
 Popular · Latest · Hot · Upcoming
11
rated 0 times [  16] [ 5]  / answers: 1 / hits: 34474  / 15 Years ago, thu, june 11, 2009, 12:00:00

I want my (ExtJS) toolbar buttons not to grab the focus on the web page when they are clicked, but to do their thing while leaving the focus unchanged by the click. How do I do that?


More From » button

 Answers
20

Cancelling the default behavior of onmousedown prevents an element from getting the focus:



// Prevent capturing focus by the button.
$('button').on('mousedown',
/** @param {!jQuery.Event} event */
function(event) {
event.preventDefault();
}
);

[#99335] Sunday, June 7, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
dustin

Total Points: 599
Total Questions: 105
Total Answers: 106

Location: Belarus
Member since Tue, Mar 14, 2023
1 Year ago
dustin questions
;