header Selector
RUN
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Học lập trình miễn phí tại freetuts.net</title> <script src="https://freetuts.net/cnd/js/jquery/jquery-3.2.1.min.js"></script> </head> <body> <h1>Học lập trình miễn phí tại freetuts.net</h1> <div id="header"> <h1>Học lập trình miễn phí tại freetuts.net</h1> <h2>Học lập trình miễn phí tại freetuts.net</h1> <b>Học lập trình miễn phí tại freetuts.net</b> </div> <div> <span>Đây là thẻ span thứ 1</span> <span class="ab va">Đây là thẻ span thứ 2</span> <span>Đây là thẻ span thứ 3</span> </div> <button onclick="myFunction()">Click vào đây để xem kết quả</button> <script> function myFunction(){ $( ":header" ).css( "color", "red"); } </script> </body> </html>
PHÓNG TO