Sto provando a riprodurre un video non appena dom è stato caricato utilizzando jQuery. Questo è il mio codice:Riproduzione automatica di un video HTML5 su Caricamento dom utilizzando jQuery
HTML
<video id="video" width="420">
<source src="http://www.w3schools.com/html/mov_bbb.mp4" type="video/mp4">
<source src="http://www.w3schools.com/html/mov_bbb.ogg" type="video/ogg">
<p>Your browser does not support HTML5 video.</p>
</video>
JS (script.js)
$(document).ready(function() {
$(#video).play();
});
Quando Dom carica il video non viene riprodotto, dove am Ho sbagliato? Grazie in anticipo.
Ho provato questo, ma ottenere l'errore: Uncaught SyntaxError: token imprevisto ILLEGALE –
aggiornamento. Hai bisogno di "" "attorno al tuo selettore. –