Home > Web Front-end > HTML Tutorial > How to set a button in html

How to set a button in html

王林
Release: 2023-01-06 11:17:56
Original
20564 people have browsed it

htmlThe way to set a button is to add a pair of ].

How to set a button in html

The operating environment of this article: windows10 system, html 5, thinkpad t480 computer.

It is very simple to set a button in HTML, because HTML provides us with a

Inside the

Common attribute values:

  • name name specifies the name of the button.

  • type button\reset\submit Specifies the type of button.

  • #value text Specifies the initial value of the button. Can be modified by script.

Code example:

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>php中文网(php.cn)</title> 
</head> 
<body>

<button type="button" onclick="alert(&#39;你好,世界!&#39;)">点我!</button>
 
</body>
</html>
Copy after login

The running effect is as shown in the figure:

How to set a button in html

Related video sharing: htmlvideo tutorial

The above is the detailed content of How to set a button in html. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template