task we are making the image to act as a button, When the user clicks the button, the
form is sent to the server. Let's look into it.
什么是图像按钮
图像按钮是通过将标签放置在
标签
By using the tag we can include an image on a HTML page. Images are not actually embedded in the webpages; instead, they are connected to them via predetermined paths. The tag consists of two required attributes namely src and alt.
When the user clicks the image button, the event gets triggered and displays an alert "Don’t hunt animals".
Example 2
在下面的示例中,我们使用创建了一个图像按钮。
creating an image Button with HTML5?
When the script gets executed, it will generate an output displaying the input field for username and password along with an image button on the webpage. When the user clicks the image button, the form gets submitted to the server.
Example 3
在下面的示例中,我们使用占位符和一个带有
SIGN IN
On running the above script, the output window will pop up, displaying the sign in provided with a placeholder for entering email along with an image button on the webpage.
Example 4
In the following we are creating a image button but inserting tag inside the tag.