Descendant Selector Example
RUN
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>all demo</title> <style> background: #efe; } div { color: red; } </style> <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="container"> <div> <div>This is a test</div> <div>This is a test 2</div> <div>This is a test 3</div> </div> <input type="text" name="test"> <input type="button" name="button" value="Button"> <h2>This is H2 content</h2> </div> <button onclick="myFunction()">Click vào đây để xem kết quả</button> <script> function myFunction(){ $( "#container div" ).css( "border", "2px solid blue" ); $( "#container div" ).css({ "backgroundColor": "yellow", "margin": "5px" }); } </script> </body> </html>
PHÓNG TO