html
html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<!--By Adekunle Mohammed-->
<!DOCTYPE html>
<html>
<head>
<title>Input reverser</title>
<meta name="viewport" content="width=device-width"/>
</head>
<body>
<section>
<h1><u>Input reverser</u></h1>
<input id="text" type="text" placeholder="Input the text"/>
<button onclick="reverse()">Get reversed Input</button>
<p id="output"><u>Output</u></p>
</section>
</body>
</html>
Enter to Rename, Shift+Enter to Preview
css
css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/*By Adekunle Mohammed*/
body{
background: #ddd;
}
section {
background: #fff;
text-align:center;
border-radius:3px;
padding:5px;
}
input[type="number"]{
margin:3px;
border:1px solid black;
}
Enter to Rename, Shift+Enter to Preview
js
js
1
2
3
4
5
6
7
8
//By Adekunle Mohammed
function reverse(){
var input = document.querySelector('#text').value;
if(input != ''){
var reversed = input.split('').reverse().join(''); document.querySelector("#output").innerHTML = "<u>Output</u><br/>The reverse of "+input+" is "+reversed;
}
else alert('Input a number!');
}
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run