<input type="button" id ="button1" value="Click Me" onclick="alert('button')" />
这里面的click事件处理函数会在 bubbling phase还是capture phase 执行? 在dom兼容浏览器里面
click
bubbling phase
capture phase
dom
一般都是bubble阶段,用这段代码测试一下就知道了:
bubble
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="en"> <head> <title>Event order test page</title> </head> <body> <div onclick="alert('outer')"> <div onclick="alert('inner')"> ************* </div> </div> </body> </html>
标签
查看
325 次