js冒泡排序
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> </head> <body> <div id="div" onclick="alert(2);"> <input type="button" id="btn" value="点击" onclick="alert(1);stopBubble(this);"/> </div> </body> <script src="http://code.jquery.com/jquery.js"></script> <script> function stopBubble(e) { if (e && e.stopPropagation) e.stopPropagation(); else window.event.cancelBubble=true ; } </script> </html>