Different browsers can be distinguished from ie-specific methods and Non-ie-specific methods
1. Add an event listener for the Element:
non ie:. AddEventListener ("click", show,false)//third parameter for event stream, true for event capture, false for event bubbling
Ie:.attachevent ("onclick", show);
2. To remove an event listener for an element:
non ie:. RemoveEventListener ("click", Show)
Ie:.detachevent ("onclick", show);
3. Stop bubbling
Non-ie:.stoppropagation ()
Ie:.cancelbubble = True '
4. Canceling the event default behavior
Non-ie:.preventdefault ()
Ie:.returnvalue = false;
5. Get values for Non-inline styles and inline styles
Non-IE:window.getComputedStyle (document.get....,null)//the First value is the acquired element, the second value is a pseudo-class, and null means no Pseudo-class
IE:document.getElementById ("xx"). Currentstyle
js method distinguishes between IE browser and non IE browser