only-child
RUN
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <style> li.active { color: red; font-size: 120%; font-style: italic; } </style> <script src="https://code.jquery.com/jquery-2.0.0.js"></script> </head> <body> <ul> <li class="delete">Cường,</li> <li>Kính,</li> <li>Chính,</li> <li>Quyền</li> </ul> <ul> <li>là thẻ UL duy nhất</li> </ul> <script> $("ul li:only-child").addClass("active"); </script> </body> </html>
PHÓNG TO