Sublime Text
<!DOCTYPE html> <html> <head> <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.12.0.min.js"></script> <script> $(document).ready(function(){ $("button").click(function(){ $("h4#abc, div").toggleClass("red big"); }) }) </script> <style type="text/css"> .red{background-color:red;} .big{font-size:30px;} </style> </head> <body> <p>Đoạn văn số 1</p> <h4>Đoạn văn số 2</h4> <h4 id="abc">Đoạn văn số 3</h4> <span>Đoạn văn số 4</span> <div>Đoạn văn số 5</div> <hr><button type="button">Click vào đây</button> </body> </html>
<!DOCTYPE html> <html> <head> <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.12.0.min.js"></script> <script> $(document).ready(function(){ $("button").click(function(){ $("h4#abc, div").toggleClass("red big"); }) }) </script> <style type="text/css"> .red{background-color:red;} .big{font-size:30px;} </style> </head> <body> <p>Đoạn văn số 1</p> <h4>Đoạn văn số 2</h4> <h4 id="abc">Đoạn văn số 3</h4> <span>Đoạn văn số 4</span> <div>Đoạn văn số 5</div> <hr><button type="button">Click vào đây</button> </body> </html>