Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1f77ef9

Browse files
solutions
1 parent 97e6b7e commit 1f77ef9

File tree

4 files changed

+137
-0
lines changed

4 files changed

+137
-0
lines changed

‎task1.html

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!DOCTYPE html>
2+
<html><head>
3+
<meta charset=utf-8 />
4+
<title>Title</title>
5+
</head>
6+
<body><form>
7+
<select id="colorSelect">
8+
<option>Red</option>
9+
<option>Green</option>
10+
<option>White</option>
11+
<option>Black</option>
12+
</select>
13+
<input type="button" onclick="removecolor()" value="Select and Remove"><br></form>
14+
</body>
15+
16+
<script>
17+
function removecolor(){
18+
var color = document.getElementById('colorSelect')
19+
for(i=0;i<color.length;i++){
20+
if(color[i].selected){
21+
console.log(color[i].value)
22+
color.removeChild(color[i])
23+
}
24+
}
25+
}
26+
</script>
27+
</html>

‎task2.html

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>Document</title>
8+
</head>
9+
<body>
10+
<h3>Zad2</h3>
11+
<br>
12+
<br>
13+
14+
15+
<button onclick="generate()" id="photos">Click me</button>
16+
17+
</body>
18+
<script>
19+
function generate(){
20+
var picture = Math.floor(Math.random() * 3);
21+
photos = document.getElementById('photos')
22+
if(parseInt(picture)==0){
23+
photos.innerHTML = `<img src="https://farm5.staticflickr.com/4060/4567292488_5d3f4b05f6_z.jpg">`
24+
}if(parseInt(picture)==1){
25+
photos.innerHTML = `<img src="https://farm5.staticflickr.com/4060/4567292488_5d3f4b05f6_z.jpg">`
26+
}else{
27+
photos.innerHTML = `<img src="https://farm5.staticflickr.com/4060/4567292488_5d3f4b05f6_z.jpg">`
28+
}
29+
}
30+
</script>
31+
</html>

‎task3.html

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8"/>
5+
<title>About Me</title>
6+
</head>
7+
<style>
8+
body{
9+
font-family: Arial, Helvetica, sans-serif;
10+
}
11+
</style>
12+
<body>
13+
<h1>About Me</h1>
14+
<ul>
15+
<li>Name: <span id="name"></span>
16+
<li>Index: <span id="index"></span>
17+
<li>Hometown: <span id="hometown"></span>
18+
</ul>
19+
<button onclick='kopce()'>Fill Data</button>
20+
</body>
21+
<script>
22+
function kopce(){
23+
var name = document.getElementById('name')
24+
var index = document.getElementById('index')
25+
var hometown = document.getElementById('hometown')
26+
27+
var name2 = prompt('Enter your name: ')
28+
var index2 = prompt('Enter you id: ')
29+
var hometown2 = prompt('Enter your city: ')
30+
31+
var c = confirm(name2 + " is your name");
32+
if(c){
33+
name.innerHTML = name2;
34+
index.innerHTML = index2;
35+
hometown.innerHTML = hometown2;
36+
}
37+
putColor();
38+
}
39+
function putColor(){
40+
var city = document.getElementById('hometown');
41+
city.parentNode.style.backgroundColor = 'red'
42+
}
43+
44+
</script>
45+
</html>

‎task4.html

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>Document</title>
8+
</head>
9+
<body>
10+
11+
<input type="number" id='prv'> <input type="number" id='vtor'><italic> i</italic> <br>
12+
<input type="number" id='tret'> <input type="number" id='chetvorti'><italic> i</italic><br>
13+
<button onclick="calculate()">Add</button>
14+
<br>
15+
<input type="number" id='petti'> <input type="number" id='shesti'><italic> i</italic>
16+
17+
</body>
18+
<script>
19+
function calculate(){
20+
var prv = document.getElementById('prv').value
21+
var vtor = document.getElementById('vtor').value
22+
var tret = document.getElementById('tret').value
23+
var chetvorti = document.getElementById('chetvorti').value
24+
var pettiV = document.getElementById('petti')
25+
var shestiV = document.getElementById('shesti')
26+
27+
28+
pettiV.value = parseInt(prv) + parseInt(tret);
29+
shestiV.value = parseInt(vtor) + parseInt(chetvorti);
30+
31+
32+
}
33+
</script>
34+
</html>

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /