Generation

generate functionWed, 05 Apr 2023

añadir un div que contenta un contador sobre un icono de carrito de compras

<html> <head> <script type="text/javascript"> function add(x, y) { return x + y; } </script> </head> <body> <h2>Añadir un div que contenta un contador sobre un icono de carrito de compras</h2> <p>Click the button to add a div element with a count of 0.</p> <button onclick="myFunction()">Try it</button> <p id="demo"></p> <script> function myFunction() { var x = document.createElement("DIV"); var t = document.createTextNode("0"); x.setAttribute("id", "cart"); x.appendChild(t); document.body.appendChild(x); } </script> </body> </html>

Javascript
Generate More

Questions about programming?Chat with your personal AI assistant