105. Event objects and compatible processing

var oDiv = document.getElemnetById("div1");

// Not only the bound method is executed, but the browser also passes a parameter value MouseEvent to this method by default: mouse event object

  1) It is a value of object data type, which contains a lot of attribute names and attribute values, which are used to record the relevant information of the current mouse

  2)MouseEvent -->UIEvent --> Event -->Object

  3) MouseEvent records the relevant information of the only mouse in the page every time it is triggered, and it has nothing to do with which element it is triggered on.

  oDiv.onclick = function () {

    console.dir(arguments) // MouseEvent 

  }

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325274334&siteId=291194637