I have a set of Div's which act as buttons. These buttons have a simple jquery click() function which works in all browsers except iOS.
For example:
<div class="button">click me</div>
and
$('.button').click(function(){
alert('hi');
});
I'm not sure why this doesn't work on iOS - clearly there is no 'clicking' in iOS.
Unfortunately I don't have an iphone device to test this myself, but I'm getting a lot of complaints from my clients who want to click things and nothing is happening.
What is the key to getting this working?
<a>
elements (you can still style them to look the way you want). And if you have paying clients who expect iPhone compatibility then you need to get yourself an iPhone for testing - you can write it off as a business expense...$.ready
is fired?click
works fine in iOS, your problem is elsewhere. And nnnnnn is right, you should also look into using<button>
.