<li onclick="show()"><a onclick="showtime()">确定</a><li>
现在点击确定时会同时触发2个事件,要怎样才能点确定只触发showtime,
注:show()这个方法也有用,不能删除jquery javascript触发事件

解决方案 »

  1.   

    so so so 哪位来帮下呀
      

  2.   

    <li onclick="show()"><a onclick="showtime();return false;">确定</a><li>
      

  3.   


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <script type="text/javascript">
    function show(){
    alert('f');
    }
    function showtime(e){
    alert('f_');
    e.stopPropagation();
    }
    </script>
    </head><body>
    <li onclick="show()"><a onclick="showtime(event)">确定</a><li>
    </body>
    </html><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <script type="text/javascript">
    function show(){
    alert('f');
    }
    function showtime(e){
    alert('f_');
    e.stopPropagation();
    }
    </script>
    </head><body>
    <li onclick="show()"><a onclick="showtime(event)">确定</a><li>
    </body>
    </html>
      

  4.   

    你的li 和 a标签都只对应确定,不知道你弄两个Onclick事件干嘛
      

  5.   

    刚才也用到这个方法了,,忘记传event了。。