Onclick不工作在iphone使用html的列表 [英] Onclick not working on list in iphone using html

查看:316
本文介绍了Onclick不工作在iphone使用html的列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在动态创建一个列表。我想调用onclick事件的列表中的函数。在列表中,我有一个标签标签

标签。onclick正在Android和黑莓,但不是在这是示例代码

I am creating a list dynamically.I want to call a function on onclick event of the list.In the list I am having a tag tag a

tag.The onclick is working on android and blackberry but not on the iphone.This is the sample code

 htmlOutput +='<a style="display: block;" onclick="getAreaCodeClicked('+area+');">
<li style="overflow: hidden;>
<img src="Star.png" style="margin:0px;float:left;" />
<p style="white-space:nowrap;">
   <label style="font-size:11px;color:black;">'+officeName+'</label><br>
   <label style="font-size:8px;color:#A1A1A1;">'+officeLocation+'</label>
</p>
</li></a>

任何人都可以告诉我出了什么问题。

can anyone please tell me what is going wrong.

推荐答案

iPhone浏览器不使用 onclick 事件,它使用 ontouch 。请检查该事件。

The iPhone browser does not use onclick events, it uses ontouch. Look in to that event instead.

这篇关于Onclick不工作在iphone使用html的列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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