Tutorials References Exercises Bootcamps Videos Menu
Sign Up Create Website Get Certified Upgrade

Using a JavaScript Library

Change this:

<script src=""></script>

To this:

<script src="https://www.w3schools.com/lib/w3.js"></script>

How to - Slideshow

JavaScript Example

<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%">

w3.slideshow(".nature", 1500);
Try it Yourself »

Hide/Show HTML Elements

JavaScript Example

<button onclick="w3.hide('#London')">Hide London</button>
<button onclick="w3.show('#London')">Show London</button>

<div id="London" class="w3-container w3-red">
  <p>London is the capital city of England.</p>

<div id="Paris" class="w3-container w3-green">
  <p>Paris is the capital of France.</p>

<div id="Tokyo" class="w3-container w3-blue">
  <p>Tokyo is the capital of Japan.</p>
Try it Yourself »


You have just learned the basics of using a JavaScript library.