Click me!]."/> Click me!].">

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

How to set a button in html

王林
王林Original
2021-06-23 10:31:4320448browse

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>

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!

Statement:
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