<style> .selected{ background-color: tomato !important; color: white; border: 2px solid red !important; } </style>
<body> <ul id="list"> <li>HTML</li> <li>CSS</li> <li>javascript</li> <li>PHP</li> <li>mySql</li> </ul> </body>
두가지 코드 모두 같은 결과 출력 $("#list :gt(1)").addClass('selected'); $("#list li:gt(1)").addClass('selected');