Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
Tags
- Linux
- 웹하드순위
- 웹하드추천
- post
- HTML
- MySQL
- JSON
- 전략
- 무료다운로드쿠폰
- Forms
- Arrays
- variables
- composer-php
- function
- date
- Session
- curl
- OOP
- Regex
- Ajax
- UTF-8
- Apache
- JavaScript
- string
- jquery
- Laravel
- file-upload
- php
- 경영
Archives
- Today
- Total
개발! 딱 깔끔하고 센스있게!
제이쿼리 this 간단 예제 본문
제이쿼리 this 간단 예제
<div onclick="test(this)" val='good'>
[제이쿼리]
</div>
<div id="test2" val='wow'>
[제이쿼리2]
</div>
<script>
//함수
function test(go)
{
alert($(go).attr("val"));
}
//$(document).ready
$(function(){
$("#test2").click(function () {
alert($(this).attr('val'));
$(this).html('zzzzzzzzz');
$(this).css('background-color','red');
});
});
//선택자 예제
//$(this)
//$("div:first")
//$("ul li:first")
//$("ul li:first-child")
//$("div#test .go")
</script>
'HTML, CSS, Jquery 메모' 카테고리의 다른 글
모바일 스크롤 페이지 구현, 페이징 (scroll paging) 만들기 (0) | 2018.10.29 |
---|---|
제이쿼리 ajax 사용방법 및 순서대로 코드실행이 안되는경우 (0) | 2018.10.29 |
제이쿼리 문자열 글자수 줄이기 간단 함수 (0) | 2018.10.24 |
Comments