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>Drop</title>
<script src="https://code.jquery.com/jquery-3.1.1.js"></script>
</head>
<body>
<div id="one"></div>
<script>
alert("Take the red square and place it into the left white square");
var i = 0;
one.onclick = function (event){
i+=1;
var k=i%2;
var styleOne = document.getElementById("one").style;
if(k==1){
styleOne.backgroundColor = "#f77";
}
else{
styleOne.backgroundColor = "red";
}
}
</script>
<div id="back"></div>
<script>
back.onclick = function (event){
var k1=i%2;
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
body {
background-color: #ccc;
}
#back{
position:absolute;
top:100px;
left:100px;
width:100px;
height:100px;
background-color: white;
border:1px solid black;
}
#back2{
position:absolute;
top:100px;
left:210px;
width:100px;
height:100px;
background-color: white;
border:1px solid black;
}
#one{
position:absolute;
top:20px;
left:20px;
width:50px;
height:50px;
background-color: red;
Enter to Rename, Shift+Enter to Preview
js
js
1
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run