"JQuery .addClass()"의 두 판 사이의 차이

(새 문서: {{소문자}} ==개요== ;jQuery .addClass() *HTML 요소에 CSS class를 추가하는 jQuery 메소드 ==예시== *예제: http://zetawiki.com/jq/addClass.html <source lang='html5'>...)
 
11번째 줄: 11번째 줄:
</style>
</style>


<script src="https://code.jquery.com/jquery.min.js"></script>
<script src="//code.jquery.com/jquery.min.js"></script>
<script>
<script>
$(function() {
$(function() {

2015년 6월 8일 (월) 19:45 판

1 개요

jQuery .addClass()
  • HTML 요소에 CSS class를 추가하는 jQuery 메소드

2 예시

<style>
.highlight { background: yellow; }
</style>

<script src="//code.jquery.com/jquery.min.js"></script>
<script>
$(function() {
	$("p").last().addClass( "highlight" );
});
</script>

<p>Hello</p>
<p>and</p>
<p>Goodbye</p>

3 같이 보기

4 참고 자료

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}