views:

17

answers:

2

I have an html "button" which is really just this:

<div onClick="window.location.href=somePage.htm">
    <img src="img.png"/>
</div>

Works fine in desktop Safari. And it works in mobile Safari... however when I tap the "button" in mobile safari I don't see the little gray outline box indicating exactly what I'm tapping. How can I get this little gray outline box to show up? I find this feature of mobile Safari to be very useful and I'd like to provide it for the user.

Cheers!

+1  A: 

You should use a link.

RoToRa
+1  A: 

I think that mobile Safari applies this to clickable elements only. Have a look at this documentation. I would suggest that you simply use a <a>-element for this purpose:

<a onclick="window.location.href = somePage.htm; return false;">
    <img src="img.png" />
</a>

This should work exactly like your <div> with a little styling.

elusive
ok using an anchor worked. However I had to just do <a href="something.htm"... instead of using the onClick.
MrDatabase