Javascript - Thay đổi kiểu văn bản
Thay đổi kiểu văn bản
Mã nguồn:
<!DOCTYPE html>
<html><head>
<meta charset=utf-8 />
<title>JS DOM paragraph style</title>
<script>
function js_style()
{
//font styles added by JS:
text.style.fontSize = "14pt";
text.style.fontFamily = "Comic Sans MS";
text.style.color = "green";
}
</script>
</head>
<body>
<p id ='text'>JavaScript Exercises - Hiepsiit</p>
<div>
<button id="jsstyle"
onclick="js_style()">Style</button>
</div>
</body>
</html>
Lưu đồ thuật toán: