Search code examples
javascriptwindow

window.blur() does not work(please test it)


For a sandwich, there is a piece of bread at the bottom.

I've tested window.blur() in

https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_win_blur

Please test the code in the above link.

But it seems it does not work. The new window does not go to the bottom. It appears on the top since it was created. I can always see the popup since clicking the button.

I have tested it in two PC(windows 7 and 10) with newest chrome, firefox, IE. But none of them worked.

Maybe I am not understanding what window.blur() mean?

P.S window.focus() works well in any case.


Solution

  • Browsers generally ignore window.blur(). This is recommended by the spec.

    User agents [browsers] are encouraged to ignore calls to this blur() method entirely.