Shifts focus away from an element if it currently has focus.
blur() method is available on all
HTMLElement. But this is not necessarily true for
SVGElement. Only Blink and WebKit expose the
blur() method on SVG elements, Gecko, Trident and Edge do not. This will likely change once SVG 2 is a thing. Until then
ally.element.blur() tries to apply
SVGElements. This only works for Internet Explorer 9 - 11, as Gecko and Edge actively prevent this.
According to jQuery Bug 9420 calling
blur() on the
body element may make the browser window lose focus.
ally.element.blur() guards against this.
var element = document.getElementById('victim'); var result = ally.element.blur(element);
||required||The Element to blur. First element of the collections is used.|
HTMLElement that received focus (usually
null if focus could not be shifted.
element argument does not resolve to an
Cannot blur SVG and MathML elements when they're not children of an HTML document.
# Related resources
ally.element.focusshifts focus to an element if it does not already have focus.