Remove or disable focus border of browser via javascript

helle picture helle · Jun 10, 2010 · Viewed 77.1k times · Source

Does anybody know how to disable or manipulate the (in most browsers) dashed border of a dom-element if it has the focus in a tabindex order?

I want to build my own style for a focused element, but it would be great to use the existing feature, because with tabindex it is possible to bind keydown event to the dom-element.

Answer

Gabriele Petrioli picture Gabriele Petrioli · Jun 10, 2010

Just make a CSS rule for the elements you want that have outline:none;