assecna questa function all'onclick
codice:function click(){ var x1 = document.getElementById('des1'); var x2 = document.getElementById('des2'); if (x2.value == ''){ // scrivo in text2 la data var time = new Date(); // ORE var h = time.getHours(); if (h<10) h="0"+ h; // MINUTI var m =time.getMinutes(); if (m<10) m= "0" + m; // SECONDI var s = time.getSeconds(); if (s<10) s= "0" + s; var tempo = " Sono le: " + h + ":" + m + ":" + s; x2.value= tempo ; } x2.disabled=true; }