LoginSignup
0
0

More than 1 year has passed since last update.

DOM の使い方

Last updated at Posted at 2022-05-11

こちらのページを参考にしました。
Updating the UI with JavaScript and DOM Methods

index.html
<!DOCTYPE html>
<html lang="ja">
<head>
<meta http-equiv="CONTENT-TYPE" content="text/html; charset=utf-8">
</head>
<body>
Hello World!<br />
<div id="app"></div>
<script type="text/javascript">
const app = document.getElementById('app')
const header = document.createElement('h1')
const headerContent = document.createTextNode(
	'こんにちは、皆さん')
header.appendChild(headerContent)
app.appendChild(header)
</script>
May/12/2022<br />
</body>
</html>

サーバーの起動

python -m http.server

http://0.0.0.0:8000/ にブラウザーでアクセス

dom_may1201.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0