제이쿼리 jQuery( ".class" )
제이쿼리 jQuery( ".class" )
설명 : 지정된 클래스가있는 모든 요소를 선택합니다.
class : 검색 할 클래스. 요소는 여러 클래스를 가질 수 있습니다. 그 중 하나만 일치해야합니다.
클래스 선택기의 경우 jQuery는 getElementsByClassName()브라우저가 지원하는 경우 JavaScript의 기본 함수를 사용 합니다.
예 :
"myClass"클래스가있는 요소를 찾습니다.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>class demo</title>
<style>
div, span {
width: 120px;
height: 40px;
float: left;
padding: 10px;
margin: 10px;
background-color: #EEEEEE;
}
</style>
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>
<div class="notMe">div class="notMe"</div>
<div class="myClass">div class="myClass"</div>
<span class="myClass">span class="myClass"</span>
<script>
$( ".myClass" ).css( "border", "3px solid red" );
</script>
</body>
</html>
게시판 목록
개발자팁
질문은 QA에서 해주시기 바랍니다.
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 4826 | jQuery | 8년 전 | 1672 | ||
| 4825 | JavaScript | 8년 전 | 2740 | ||
| 4824 | jQuery | 8년 전 | 1465 | ||
| 4823 | jQuery | 8년 전 | 1727 | ||
| 4822 | jQuery | 8년 전 | 1812 | ||
| 4821 | jQuery | 8년 전 | 1641 | ||
| 4820 | jQuery | 8년 전 | 1648 | ||
| 4819 | jQuery | 8년 전 | 1329 | ||
| 4818 | jQuery | 8년 전 | 1969 | ||
| 4817 | jQuery | 8년 전 | 2409 | ||
| 4816 | jQuery | 8년 전 | 1706 | ||
| 4815 | jQuery | 8년 전 | 1422 | ||
| 4814 | jQuery | 8년 전 | 1839 | ||
| 4813 | jQuery | 8년 전 | 5413 | ||
| 4812 | 기타 | 8년 전 | 3164 | ||
| 4811 | jQuery | 8년 전 | 1545 | ||
| 4810 | jQuery | 8년 전 | 1717 | ||
| 4809 | jQuery | 8년 전 | 1806 | ||
| 4808 | PHP |
|
8년 전 | 5085 | |
| 4807 | node.js |
|
8년 전 | 4120 | |
| 4806 | jQuery | 8년 전 | 2219 | ||
| 4805 | jQuery | 8년 전 | 1653 | ||
| 4804 | jQuery | 8년 전 | 1201 | ||
| 4803 | jQuery | 8년 전 | 1913 | ||
| 4802 | jQuery | 8년 전 | 1418 | ||
| 4801 | jQuery | 8년 전 | 1522 | ||
| 4800 | jQuery | 8년 전 | 1742 | ||
| 4799 | jQuery | 8년 전 | 1985 | ||
| 4798 | jQuery | 8년 전 | 1521 | ||
| 4797 | jQuery | 8년 전 | 1457 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기