简体   繁体   中英

How to make clickable image that open new tab with message

I have HTML and CSS page and I need to make one image clickable and have to open new page with message "You order is complete"

The button actually confirm form with several fields over which it is located. Can you help me do that?

Well at the very basic you can wrap your image in a hyperlink.
Adding the attribute target="_blank" tells the browser to open the link in a new tab or window.

<a href="http://www.google.com" target="_blank">
    <img src="http://www.google.co.uk/images/srpr/logo11w.png" width="400" height="100" alt="Google"/>
</a>

This code may help you open your desired new page with the contents you mentioned.

<a href="myPage.html" target="_blank" >
<img src="myImage.png" alt="some image" />
</a>

and myPage.html will contain the following

<body>
<p>You order is complete</p>
</body

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM