简体   繁体   English

定位标记中的Onclick功能不起作用

[英]Onclick function in anchor tag is not working

This is my code 这是我的代码

    <div id="bodyForm" style="display: none" class="feedback-modal feedback-css" data-html2canvas-ignore="true">
    <div class="feedback-header" id="headerDiv">
        <a class="feedback-close" id="closeSnip" onclick="close();">X</a>
        <h4 id="feedbackHeader">Contact Development (Beta)</h4>
    </div>

close() is not working close()无法正常工作

function close(){
    $j("#bodyForm").css("dsiplay", "none");
document.getElementsByTagName("body")[0].className = "small";
         document.getElementsByTagName("body")[0].style = "";
        document.getElementsByTagName("body")[0].draggable = true;
        return false;
}

i tried event listener its not working too please help 我尝试过事件监听器也无法正常工作,请帮助

Try this in the js: 在js中尝试一下:

document.getElementById("closeSnip").onclick = close;

and remove the onClick attribute from the html 并从html中删除onClick属性

在此处输入图片说明

As shown in the picture. 如图所示。 Maybe you typed a wrong word. 也许您输入了错误的单词。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM