Why is the onclick function return false not triggered in JavaScript?
滿天的星座
滿天的星座 2017-05-19 10:39:07
0
2
572

According to the javascript dom programming art about the part of the web page that displays pictures, the code is typed out. There is a section that requires input onclick="showPic(this);return false;" to prevent the web page from popping up new links to view pictures. But when I finally ran it, a new link still popped up. The specific code is as follows:


    My Gallery 

snapshots

My Gallery
滿天的星座
滿天的星座

reply all (2)
迷茫

First of all, the words you get the id are spelled wrong, and secondly, the href pointing problem of the a tag conflicts with the click event



< meta charset="utf-8"/>
My Gallery



snapshots



My Gallery


    大家讲道理

    Getting the id is document.getElementById('')

      Latest Downloads
      More>
      Web Effects
      Website Source Code
      Website Materials
      Front End Template
      About us Disclaimer Sitemap
      php.cn:Public welfare online PHP training,Help PHP learners grow quickly!