html
html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>
Remove Spaces from a String
Challenge
</h1>
<p>Given a string as input, output it without spaces.
<br/><br/>
For example:
string = "ab c d e fgh i j kl mn opqr stuvwxyz"
<br/>
result = "abcdefghijklmnopqrstuvwxyz"
</p>
<input id="text" placeholder="Enter your text">
<button id="butt">Remove</button>
<p id="answer"></p>
<hr>
<p class="quote"><a href="https://www.sololearn.com/Profile/8412719">Made by uni</a></p>
<hr>
<p id="time"></p>
<script>
function printtime(){
var o=document.getElementById("time");
Enter to Rename, Shift+Enter to Preview
css
css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
h1{
text-decoration:underline;
text-align:center;
font-family:Courier;
border: 2px dotted black;
}
p.quote{
text-decoration:underline;
text-align:right;
font-family:cursive;
color: blue;
}
hr{
color: orange;
border-color: orange;
}
html{
background-color: lightblue;
}
input{
color: blue;
background-color: lightgreen;
border-color: orange;
border-radius:3px;
}
button{
color: blue;
border-color: lightgreen;
Enter to Rename, Shift+Enter to Preview
js
js
1
2
3
4
5
6
7
8
9
10
window.onload=function(){
var b = document.getElementById("butt");
b.addEventListener("click",prog);
function prog(){
var text =document.getElementById("text").value;
text = text.replace(/\s+/g,'');
var p= document.getElementById("answer");
p.innerHTML+=text;
}
}
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run