I Use A Otp Genrate Function
// Function to generate OTP function generateOTP() { // Declare a digits variable // which stores all digits var d