Note the reason:
The attachEvent method of the window object is only valid in the IE browser. Other browsers do not support this method, so an error is reported.
is not a function is actually the previous code, which is not compatible with Chrome and Firefox browsers.
("onblur",function(){="none"})
The above code will definitely report an error in the chrome browser.
Because the chrome browser binding event does not support attachment but supports addEventListener.
Here is a temporary solution:
if(!){ ("onblur",function(){="none"}) }
But the effect will be lost, this will not report an error but the effect will be gone.
IE:(”onclick”, func);。
FF:(”click”, func, true)。
General: =func. Although both can use onclick events, the effects of onclick and the above two methods are different. Onclick only executes one process, while attachEvent and addEventListener execute a list of procedures, that is, multiple processes. For example: ("onclick", func1); ("onclick", func2) In this way, both func1 and func2 are executed.
We recommend that you refer to the method of this article to solve the problem:https:///article/