-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
44 lines (43 loc) · 1.47 KB
/
index.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<script src='random-name.js'></script>
<script src='random-pokemon.js'></script>
<script src='random-country.js'></script>
<title>Random-随机</title>
</head>
<body>
<div style="text-align: center;margin-top: 200px;">
<h1>点击按钮👇———————— 一切随机🎲</h1>
<div>
<button onclick="ChineseName()">随机中国姓名</button>
<button onclick="PokemonName()">随机宝可梦</button>
<button onclick="Country()">随机国家</button>
</div>
<div id="display">
<p id="text"></p>
<img id="random_img" src="">
</div>
</div>
</body>
<script>
function ChineseName()
{
document.getElementById("text").innerText=RandomChineseName.random();
}
function PokemonName()
{
let p=RandomPokemon.random();
document.getElementById("text").innerText=p.Chinese +' '+p.Japanese+' '+p.English;
document.getElementById("random_img").src=p.img;
}
function Country()
{
let c=RandomCountry.random();
document.getElementById("text").innerText=c.translation+" "+c.name ;
document.getElementById("random_img").src=c.flag;
}
PokemonName()
</script>
</html>