What's wrong with my code?
Hi
I try to follow this video
I want to create a clone of my image but no luck
Please look at my code:
- <html>
- <head>
-
- <script
- src="http://code.jquery.com/jquery-3.3.1.min.js"
- integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
- crossorigin="anonymous"></script>
- <style>
- .zoom{
- position:absolute;
- top:40px;
- }
- </style>
- </head>
- <body>
- <ul>
- <li><img src="rosa.jpg">
- <h2>Tshirt Rosa</h2>
- <button type="button">Comprar!</button>
- </li>
- <li><img src="branca.jpg">
- <h2>Tshirt Branca</h2>
- <button type="button">Comprar!</button>
- </li>
- <li><img src="azul.jpg">
- <h2>Tshirt Azul</h2>
- <button type="button">Comprar!</button>
- </li>
- </ul>
- <script>
- $("button").click(function() {
- alert( "Handler for .click() called." );
- $(this).closest("li")
- .find("img")
- .clone()
- .addclass("zoom")
- .appendTo("body");
- setTimeout(function(){
- $(".zoom").remove();
- },1000);
- });
- </script>
- </body>
- </html>
What's wrong?
The message box shows but nothing happens
Thank you