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>event paire img button </title>
<script>
function responseTrue (){
var el = document.querySelector ("img");
el.setAttribute ("src","https://mimo.app/i/panda.png");
}
function responseFalse (){
var el = document.querySelector ("img");
el.setAttribute ("src","https://mimo.app/i/cat.png");
}
</script>
</head>
<body>
<script>
window.onload = () =>{
//begin structure
//img
var img = document.createElement ("img");
//set
img.setAttribute ("src","https://mimo.app/i/cat.png");
//style
img.style.display = "inline";
img.style.width = "45vw";
//browser
document.body.appendChild (img);
Enter to Rename, Shift+Enter to Preview
css
css
1
2
3
body {
}
Enter to Rename, Shift+Enter to Preview
js
js
1
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run