Sử dụng Thư viện JavaScript
Thay đổi điều này:
<script src=""></script>
Về điều này:
<script src="https://www.w3schools.com/lib/w3.js"></script>
Cách thực hiện - Trình chiếu
Ví dụ về JavaScript
<img class="nature" src="img_snowtops.jpg" width="100%">
<img class="nature" src="img_mountains.jpg" width="100%">
<img class="nature" src="img_nature.jpg" width="100%">
<script>
w3.slideshow(".nature", 1500);
</script>
Ẩn / Hiện các phần tử HTML
Ví dụ về JavaScript
<p>
<button onclick="w3.hide('#London')">Hide London</button>
<button
onclick="w3.show('#London')">Show London</button>
</p>
<div
id="London" class="w3-container w3-red">
<h2>London</h2>
<p>London is
the capital city of England.</p>
</div>
<div id="Paris"
class="w3-container w3-green">
<h2>Paris</h2>
<p>Paris is the capital of
France.</p>
</div>
<div id="Tokyo" class="w3-container w3-blue">
<h2>Tokyo</h2>
<p>Tokyo is the capital of Japan.</p>
</div>
Xin chúc mừng!
Bạn vừa học những kiến thức cơ bản về cách sử dụng thư viện JavaScript.