It is defined in ECMAScript 3rd edition. It is available in IE 5.5+ and all in-use versions of Firefox, Chrome, Opera and Safari.
You can use it safe in the knowledge that it will work.
You should err on the side of caution when using it to check event support. All implementations except older Firefox versions support "eventname" in element
as a test for DOM events.
"onclick" in document.body; // -> false in old Fx, true in others
document.body.setAttribute("onclick", "");
typeof(document.body.onclick == "function"); // -> true in Fx
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…