javascript - onclick事件点击不起作用

查看:120
本文介绍了javascript - onclick事件点击不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

1 不知道为什么onclick事件不起作用了。。。
html
<div id="leftSide_xia" style="display:none;text-align:center;">

                    <ul class="" style="margin-top:10px;">
                    <!-- <li  style="height:52px;cursor:pointer;" onclick="openIllegalPage('isOnList')">wwwwwww</li>-->
                    <div onclick="openIllegalPage('websiteList')"><img name="leftSide_xia_menu"  onclick="openIllegalPage('websiteList')" src="/images/frame/icon_a.png" style="margin-left:35px;float:left;margin-top:6px;"/><li  onclick="openIllegalPage('websiteList')" style="height:30px;cursor:pointer;" ><a  onclick="openIllegalPage('websiteList')" style="margin-right:25%;">wwww览</a> </li><hr  style="border:0;background-color:rgb(8,30,44);height:2px;margin-top:0px;width:90%;"/>
                       </div>
                    <div onclick="openIllegalPage('websiteNameList')"><img name="leftSide_xia_menu" src="/images/frame/icon_a.png" style="margin-left:35px;float:left;margin-top:6px;"/><li  style="height:30px;cursor:pointer;" ><a style="margin-right:25%;">wwwwwwww</a></li><hr  style="border:0;background-color:rgb(8,30,44);height:1px;margin-top:0px ;width:90%;"/>
                       </div>
                    <div>
                        <img name="leftSide_xia_menu" src="/images/frame/icon_a.png" style="margin-left:35px;float:left;margin-top:6px;"/><li  style="height:30px;cursor:pointer;" onclick="openIllegalPage('recordNumberList')"><a style="margin-right:28%;">wwwwwwww/a></li></li><hr  style="border:0;background-color:rgb(8,30,44);height:1px;margin-top:0px ;width:90%;"/>
                    </div>
                    <div><img name="leftSide_xia_menu" src="/images/frame/icon_a.png" style="margin-left:35px;float:left;margin-top:6px;"/><li  style="height:30px;cursor:pointer;" onclick="openIllegalPage('unitNameList')"><a style="margin-right:25%;">wwwwww</a></li><hr  style="border:0;background-color:rgb(8,30,44);height:1px;margin-top:0px ;width:90%;"/>
                       </div>
                    <div><img name="leftSide_xia_menu" src="/images/frame/icon_a.png" style="margin-left:35px;float:left;margin-top:6px;"/><li  style="height:30px;cursor:pointer;" onclick="openIllegalPage('contactNameList')"><a style="margin-right:28%;">wwwwwwww</a></li><hr  style="border:0;background-color:rgb(8,30,44);height:2px;margin-top:0px ;width:90%;"/>
                       </div>
                    <div><img name="leftSide_xia_menu" src="/images/frame/icon_a.png" style="margin-left:35px;float:left;margin-top:6px;"/><li  style="height:30px;cursor:pointer;" onclick="openIllegalPage('contactNameList')"><a style="margin-right:20%;">wwwwww</a></li><hr  style="border:0;background-color:rgb(8,30,44);height:1px;margin-top:0px ;width:90%;"/>
                       </div>
                    <div><img name="leftSide_xia_menu" src="/images/frame/icon_a.png" style="margin-left:35px;float:left;margin-top:6px;"/><li  style="height:30px;cursor:pointer;" onclick="openIllegalPage('contactTelephoneList')"><a style="margin-right:10%;">wwwwwww</a></li><hr  style="border:0;background-color:rgb(8,30,44);height:1px;margin-top:0px ;width:90%;"/>
                </div>
                    </ul> 
                </div>
                


解决方案

<div onclick="openIllegalPage('websiteList')">

function openIllegalPage(ppp,pageName){
    if(pageName=="websiteList")
}

注意一下参数

这篇关于javascript - onclick事件点击不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆