Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AWS AI GO KOTLIN SASS VUE GEN AI SCIPY CYBERSECURITY DATA SCIENCE
     ❯   

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

<script>
w3.slideshow(".nature", 1500);
</script>
Try it Yourself »

Hide/Show HTML Elements

JavaScript Example

<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>
Try it Yourself »

Congratulations!

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


W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.

Copyright 1999-2023 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.