<!DOCTYPE html>
<html>
<meta charset="utf-8">
<title>编程狮(w3cschool.cn)</title>
<style>
.marked {
color: red;
font-size: 30px;
}
</style>
<script src="https://7npmedia.w3cschool.cn/w3.js"></script>
<body>
<h2>测试 HTML 中的 W3.JS</h2>
<p>点击按钮将 marked 类添加到h2元素中.</p>
<p><button onclick="w3.addClass('h2','marked')">添加类</button></p>
<div id="London" class="city">
<h2>伦敦</h2>
<p>伦敦是英国的首都.</p>
</div>
<div id="Paris" class="city">
<h2>巴黎</h2>
<p>巴黎是法国的首都.</p>
</div>
<div id="Tokyo" class="city">
<h2>东京</h2>
<p>东京是日本的首都.</p>
</div>
</body>
</html>