0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

HTML DOM - 基本觀念 By 彭彭 18

Last updated at Posted at 2018-08-18
6. HTML DOM 處理網頁畫面的重要關鍵

WS000000.JPG

<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8"></meta>
	<title>HTML DOM</title>

	<script type="text/javascript">
	// 測試熒幕解析度 1536x864
	alert(window.screen.width + "x" + window.screen.height)
	function Change(){
		// 内建應用ElementById
		var spanObj = document.getElementById("emotion");
		spanObj.innerHTML = "悪いから、うちで寝る";
		// css的設置 改變顔色字體
		spanObj.style.color = "red";
		spanObj.style.fontweight = "bold";
		// 隱藏起來 display:none
		//spanObj.style.display = "none";
	}
	</script>

</head>
	<body>
		<div>
			<!-- 對畫面進行部分更新 -->
			天気が<span id = "emotion">いいから散歩しましょう</span>
		</div>
		<button onclick = "Change();">Change</button>
	
	</body>
</html>
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?