Web.QHMIT
.com
Toggle navigation
☰
Home
HTML
CSS
Scripting
Database
Run
<!DOCTYPE html> <title>My Example</title> <style> p { background: gold; padding: 20px; } </style> <!-- Load jQuery --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> <!-- Use jQuery --> <script> // Wait for DOM to load and be ready $(document).ready(function(){ // Listen for a click event $( "p" ).click(function() { // Fade out the current element $( this ).fadeOut(); }); }); </script> <p>1. Click me to fade me out.</p> <p>2. Click me to fade me out.</p> <p>3. Click me to fade me out.</p> <p>4. Click me to fade me out.</p>
Preview