search

Home  >  Q&A  >  body text

html5 - html图片点击事件找不到

在做app与h5交互的时候,碰到的问题。

<p class="p_pic">
<img src="http://www.baidu.com/xxxxx.jpg">
</p>

有这样的一张图片,我点击以后就会有一些效果,这个怎么没有对应的onClick之类的东西?

PHPzPHPz2776 days ago959

reply all(5)I'll reply

  • 大家讲道理

    大家讲道理2017-04-17 11:46:54

    It is recommended that you use firebug to click F12 on Firefox, then select the picture and click events on the right to see all the events bound to this picture

    reply
    0
  • PHPz

    PHPz2017-04-17 11:46:54

    http://www.runoob.com/js/js-htmldom-eventlistener.html

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 11:46:54

    It may be added elsewhere, you can search for "click" in all js. I use Yslow's all script as the browser. For apps, debugging seems more troublesome.

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 11:46:54

    The click event in HTML is onclick, not onClick. Pay attention to the case

    reply
    0
  • 迷茫

    迷茫2017-04-17 11:46:54

    $('.p_pic img').on('click',function(){
        //todo ...
    })

    reply
    0
  • Cancelreply