Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Help write a js script
Help write a js script
& lthtml & gt

& lthead & gt

& lttitle & gt change font size

& lt/head & gt;

& ltscript type = " text/JavaScript " & gt;

window.onload=function(){

document.getElementById("big ")。 onclick=function(){

document . body . style . font size = parse int(document . body . style . font size)+ 1;

}

document.getElementById("small ")。 onclick=function(){

document . body . style . font size = parse int(document . body . style . font size)- 1;

}

}

& lt/script & gt;

& ltbody style = " font-size: 12px " >

sdfadfsasdfdsaf

& ltbr/>; & ltbutton id = "big"> Bigger.

& ltbutton id = "small"> get smaller.

& lt/body & gt;

& lt/html & gt;