<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<!DOCTYPE html>
<html>
<body>
<h2>Print Even or Odd Numbers Task</h2><br>
Enter the Number :
<input id="demo1" type="number" name="txt1" placeholder="give any number"><br><br>
Click here :<button id="demo2" onclick="myFunction()">Click</button><br><br>
List of the Even Number :
<input id="print1" type="text" name="text2"><br><br>
List of the Odd Number :
<input id="print2" type="text" name="txt3">
<script>
function myFunction()
{
var x1=document.getElementById("demo1").value;
var even="";
var odd="";
for(i=0; i<x1;i++)
if(i%2==0)
{
even+=i+",";
}
else
{
odd+=i+",";
}
document.getElementById("print1").value=even;
document.getElementById("print2").value=odd;
}
</script>
</body>
</html>