add method "attachEvent" to be compatible with IE8 and IE9