<div class="main">
<p id="massage"></p>
<button class="btn" onclick="getotp()">Get OTP</button>
</div>
body{
background-color:black;
}
.main{
margin:50px 100px;
color:white;
}
.btn{
margin-left:20px;
background-image:linear-gradient(45deg,#e65d0e 5px,#ede9e6,#067309);
}
const msg=document.getElementById("massage");
const msg1="<marquee> Don't Share Your One Time Password (OTP) </marquee>";
function getotp(){
var numbers=[0,1,2,3,4,5,6,7,8,9];
var otp=[];
for(let i=0; i<6 ; i++){
otp += numbers[Math.floor(Math.random()*10)];
}
return (msg.innerHTML=(msg1+'<h1>'+ otp +'</h1>'));
};
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.