Home >Web Front-end >JS Tutorial >React generates unordered list

React generates unordered list

黄舟
黄舟Original
2017-02-16 13:41:131257browse

1. Problem background

Use React to generate an unordered list. The list shows the four seasons of the year


2. Implementation source code

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>React之无序列表</title>
		<script type="text/javascript" src="../js/react.js" ></script>
		<script type="text/javascript" src="../js/react-dom.js" ></script>
		<script type="text/javascript" src="../js/browser.min.js" ></script>
		<script type="text/babel">
			ReactDOM.render(
				<ul>
					<li>春季</li>
					<li>夏季</li>
					<li>秋季</li>
					<li>冬季</li>
				</ul>,
				document.getElementById(&#39;ul&#39;)
			);
		</script>
	</head>
	<body>
		<p id="ul"></p>
	</body>
</html>


3. Implementation result

React generates unordered list

The above is the content of React generating an unordered list. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!


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