0

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.

Abhijit C
  • 303
  • 3
  • 20

1 Answers1

1

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

Ashley Strout
  • 6,107
  • 5
  • 25
  • 45
  • Hi David.I have binded this event with the tap. So I think this is not the problem. I think it is related to applying the click event on the whole list. – Abhijit C Jul 12 '12 at 11:46