Javascript examples for DOM HTML Element:Input Submit
display random number after form submission?
<html> <head></head> <body> <form> <input type="submit" id="ref" name="submit" value="submit"> </form> <script> var stampmonths = new Array( "01","02","03","04","05","06","07","08","09","10","11","12"); var rnd = Math.floor((Math.random() * 9) + 1);; var thedate = new Date();/*from ww w .ja v a 2 s. com*/ document.getElementById('ref').value = rnd.toString() + stampmonths[thedate.getMonth()] + thedate.getDate() + thedate.getFullYear() + thedate.getSeconds(); </script> </body> </html>