JSFiddle - React, Tailwind, and code Playground

by Roydon DSouza

HTML

<!DOCTYPE html>
<html>
<body>

<p>Click the button to demonstrate the prompt box.</p>

<button onclick="myFunction()">Try it</button>
    
    <input type="text" name="int1" id="int1" />
    <input type="text" name="int2"  id="int2" />
        

<script>
function myFunction() {
    var data = prompt("Please enter your name", "12,13");
    if (data != null) {
        var result=data.split(',');
    //add a loop and some logic here 
         document.getElementById("int1").value =result[0];
         document.getElementById("int2").value =result[1];
       
    }
}
</script>

</body>
</html>