Home >Web Front-end >HTML Tutorial >What is the difference between the two ways of defining a button? _html/css_WEB-ITnose

What is the difference between the two ways of defining a button? _html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:23:201447browse

<!DOCTYPE html><html><head><meta charset="UTF-8"><title>Insert title here</title></head><body>	通过层次关系获取节点..		<!-- 方式1 -->	<button value="层次关系获取节点练习.." onclick="getNodeDemo">FUCK</button>		<!-- 方式2 -->	<input type="button" value="层次关系获取节点" onclick="getNodeDemo"/></body></html>


Reply to discussion (solution)

Use it however you want without doctype declaration. If there is a doctype, use input type=button

In fact, the code you write is also very clear. button is a label pair, and input type=button is an independent label
, which means that button can have child elements. For example, a picture a1f02c36ba31691bcfe87b2722de723b, and the input button can only use input type=image

For details, please see
http://www.w3.org/TR/html4/interact/forms.html #edef-BUTTON

Indeed, the correct answer is upstairs

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