.a, .b, .c {
font-size
:
26px
;
}
.a {
color
#F00
.b {
#0F0
.c {
#00F
input {
width
60px
function
funA() {
document.getElementById(
'p1'
).className =
'a'
'd1'
).innerHTML =
'<h3>class '
+ document.getElementById(
).className +
'</h3>'
funB() {
'b'
funC() {
'c'
window.onload =
() {
for
(
var
i=1; i<=3; i++) {
if
(i==1) {
+ i).onclick = funA;
(i==2) {
+ i).onclick = funB;
(i==3) {
+ i).onclick = funC;
<!DOCTYPE html>
<
html
>
head
meta
charset
=
"utf-8"
/>
title
>New Page</
link
href
"css/style.css"
rel
"stylesheet"
script
src
"js/script.js"
></
</
body
p
id
"p1"
class
"a"
>Hello World!</
br
input
type
"button"
"b1"
value
"Red"
"b2"
"Green"
"b3"
"Blue"
div
"d1"