Hi,
I have 2 scrpts in my registeration page
1st one is for displaying autogenerated number inside the textbox
2nd one is for playing audio at the page load
when these 2 scrpts are active one will not work
if audio script is active then the autogenerated number will not be displayed. If I comment the audio script then the autogenerated number will be displayed. Is there any way I can work both scripts same time
<script type="text/javascript">
        now = new Date();
        randomNum = '';
        randomNum += Math.round(Math.random() * 9);
        randomNum += Math.round(Math.random() * 9);
        randomNum += now.getTime().toString().slice(-4);
        window.onload = function () {
            document.getElementById("txt_usrid").value = randomNum;
        }
    </script>
 
<script type="text/javascript">
        window.onload = function () {
            document.getElementById("my_audio").play();
        }
    </script>
 
<audio id="my_audio" src="audio/ew.mp3" loop="loop"></audio>
<input type="text" id="txt_usrid" readonly="readonly"><label style="color:red;font-size:15px; ">* Write down the user id shown above</label>