Touch equal mouse click

Discussion in 'JavaScript' started by alric, May 17, 2010.

  1. #1
    Hi all,

    I have a question about a touch (tap on a smartphone with touchscreen) and a mouse click

    For example:
    let's say that I have the following element

    Code:

    
    <html>
    <body>
        <div onclick='javascript:alert("You have clicked me.")'>
        Click Me.
        </div>
    </body>
    </html>
    
    Code (markup):
    If an user with a smartphone let say Apple's Iphone will load a html file that contains this code and Tap on the text with the finger will it launch alert Javascript window or do I need to use something else and not onclick?

    If yes like what?

    Thank you
     
    alric, May 17, 2010 IP