chcę wyświetlic w inpucie aktualna godzine tylko mam z tym problem
gdy daje taki kod:
setInterval( function() { var hours = d.getHours(); var minutes = d.getMinutes(); var seconds = d.getSeconds(); $(\"#time\").html(( hours < 10 ? \"0\" : \"\" ) + hours + ':' + ( minutes < 10 ? \"0\" : \"\" ) + minutes + ':' + ( seconds < 10 ? \"0\" : \"\" ) + seconds); }, 1000); }); </script>
to wyswietla jednak po sekundzie kasuje inputa i wyswietla czas prosto na stronie
z kolei gdy zamienie $(\"#time\").html na $(\"#time\").val ,aby nadac wartość formularza to nie odświeza godziny. co może być powodem ?