Two, JavaScript click on the button to change HTML styles (CSS)

A, as follows

Second, before clicking

Third, click

<! DOCTYPE HTML> 
<HTML> 
<Meta HTTP-equiv = "Content-Type" Content = "text / HTML; charset = UTF-8" /> 
<body> 

<h2> JavaScript can do </ h2> 

<the p- id = "demo"> JavaScript can change the style of HTML elements. </ the p-> 

<the Button of the type = "the Button" onclick = "document.getElementById ( 'Demo'). style.fontSize = '35px'"> 
Click me! 
</ Button> 

</ body> 
</ HTML>

 

Guess you like

Origin www.cnblogs.com/tianpan2019/p/11302321.html