File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html >
3+
4+ < head >
5+ < script src ="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js "> </ script >
6+ < script >
7+ $ ( document ) . ready ( function ( ) {
8+ $ ( "#setCssBtn" ) . click ( function ( ) {
9+ $ ( "p" ) . css ( { "background-color" : "#ace60e" , "font-size" : "210%" } ) ;
10+ } ) ;
11+
12+ $ ( "#removeStylesBtn" ) . click ( function ( ) {
13+ $ ( "p" ) . removeAttr ( "style" ) ;
14+ } ) ;
15+ } ) ;
16+ </ script >
17+ </ head >
18+
19+ < body >
20+
21+ < h2 > This is a heading</ h2 >
22+
23+ < p style ="background-color:#ff0000 "> This is a paragraph 1.</ p >
24+ < p style ="background-color:#00ff00 "> This is a paragraph 2.</ p >
25+ < p style ="background-color:#0000ff "> This is a paragraph 3.</ p >
26+
27+ < p > This is a paragraph 4.</ p >
28+
29+ < button id ="setCssBtn "> Set multiple styles for p</ button >
30+ < button id ="removeStylesBtn "> Remove multiple styles</ button >
31+
32+ </ body >
33+
34+ </ html >
You can’t perform that action at this time.
0 commit comments