File tree Expand file tree Collapse file tree 2 files changed +37
-11
lines changed
Expand file tree Collapse file tree 2 files changed +37
-11
lines changed Original file line number Diff line number Diff line change 99</ head >
1010
1111< body >
12- < h1 id ="p1 ">
12+ < h1 id ="h ">
1313 < p > 123</ p >
14- < p > 456</ p >
1514 </ h1 >
16- < h1 id ="p2 ">
17- < p > 123</ p >
15+ < h1 class ="a1 ">
16+ < p > 1</ p >
17+ </ h1 >
18+ < h1 class ="a1 ">
19+ < p > 2</ p >
1820 </ h1 >
21+ < h1 class ="a1 ">
22+ < p > 3</ p >
23+ </ h1 >
24+ < button onclick ="a() "> 点我变456</ button >
25+ < button onclick ="b() "> 点我变123</ button >
26+ < input type ="text " onkeydown ="key() "> </ input >
1927</ body >
2028
2129</ html >
22- < script >
23- window . alert ( "alert" ) ;
24- // document.write("123");
25- document . getElementById ( "p1" ) . innerHTML = 456 ;
26- console . log ( document . getElementById ( "p1" ) . innerHTML )
27- console . log ( document . getElementById ( "p2" ) . innerText )
28- </ script >
30+
31+ < script src ="11.js "> </ script >
Original file line number Diff line number Diff line change 1+ // document.getElementById("h").innerHTML = 456
2+ // // console.log(document.getElementsByClassName("a1"))
3+ // document.getElementsByClassName("a1")[0].innerHTML = 4
4+ // var revise = document.getElementsByClassName("a1")
5+ // revise[0].innerHTML = "revise[0]"
6+ // // console.log(document.getElementById("h").innerHTML)
7+ // // console.log(document.getElementById("h").innerText)
8+ // document.getElementsByClassName("a1")[0].style.background = "red"
9+ function a ( )
10+ {
11+ document . getElementById ( "h" ) . innerHTML = 456
12+ }
13+ function b ( )
14+ {
15+ document . getElementById ( "h" ) . innerHTML = 123
16+ }
17+ function key ( )
18+ {
19+ console . log ( event . key )
20+ if ( event . key == ' ' ) {
21+ alert ( "\" \"" )
22+ }
23+ }
You can’t perform that action at this time.
0 commit comments