jQuery | jQuery 자주쓰는 함수
페이지 정보
작성자 굿스웹 작성일19-11-19 09:38 조회759회 댓글0건관련링크
본문
<script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>
alert(data.result_msg); //메시지 창
window.open(hreft); //새창
document.location.href //페이지 이동
$('input[type=text]').val("텍스트 값추가");
$('tr:odd').css('background', '#F9F9F9');
$('tr:event').css('background', '#9F9F9F');
$('tr:first').css('background', '#333333').css('color','#FFFFFF'); // 배경색 / 글자색
$('tr:eq(0)').css('background', '#000000').css('color', 'White');
$('선택').addClass('정의한 클래스이름');
$('선택'). removeClass ('삭제할 클래스이름');
arrt()
=> $('img').attr('src');
=> $(selector).attr(속성이름 , 속성값);
=> $(selector).attr(속성이름 , function( 속성각각의 index값 ,attr ){} );
=> $(selector).attr(object);
=> $('<img />').attr('src', 'image.jpg').appendTo('body'); // body 에 img태스생성
=> $('<img />' , {src:''image.jpg, width:350, height:250}).appendTo('body');
$('h1').removeAttr('data-index') //제거
css()
$(selector).css(name , value); //추가
$('h1').html()
$(selector). text (value);
$('h1').first().remove(); // 첫번쩨 h1 삭제
trigger() //이벤트강제 발생
$(selector).trigger(eventName)
//class 클릭
$(document).on("click", ".winhref", function () {
});
function popup(){
}
$(this). //현재위치
//통신 보내기
var param = {
"group" : gro,
"type" : gpm
}
$.ajax({
type : "POST",
url : "a.php",
data : param,
dataType: "json",
success : function (data) {}
});
//버튼클릭 이동
$(document).on("click", ".href", function () {
var hreft = $(this).attr("href");
if(hreft) document.location.href = hreft;
});
//새창
$(document).on("click", ".winhref", function () {
var hreft = $(this).attr("href");
if(hreft) window.open(hreft);
});
img class="winhref m_logcode" href='이동할주소'
[숫자 콤마 찍기]
return data.replace(/(\d)(?=(?:\d{3})+(?!\d))/g, '$1,');
[숫자 콤마 삭제]
return str.replace(/[^\d]+/g, '');
alert(data.result_msg); //메시지 창
window.open(hreft); //새창
document.location.href //페이지 이동
$('input[type=text]').val("텍스트 값추가");
$('tr:odd').css('background', '#F9F9F9');
$('tr:event').css('background', '#9F9F9F');
$('tr:first').css('background', '#333333').css('color','#FFFFFF'); // 배경색 / 글자색
$('tr:eq(0)').css('background', '#000000').css('color', 'White');
$('선택').addClass('정의한 클래스이름');
$('선택'). removeClass ('삭제할 클래스이름');
arrt()
=> $('img').attr('src');
=> $(selector).attr(속성이름 , 속성값);
=> $(selector).attr(속성이름 , function( 속성각각의 index값 ,attr ){} );
=> $(selector).attr(object);
=> $('<img />').attr('src', 'image.jpg').appendTo('body'); // body 에 img태스생성
=> $('<img />' , {src:''image.jpg, width:350, height:250}).appendTo('body');
$('h1').removeAttr('data-index') //제거
css()
$(selector).css(name , value); //추가
$('h1').html()
$(selector). text (value);
$('h1').first().remove(); // 첫번쩨 h1 삭제
trigger() //이벤트강제 발생
$(selector).trigger(eventName)
//class 클릭
$(document).on("click", ".winhref", function () {
});
function popup(){
}
$(this). //현재위치
//통신 보내기
var param = {
"group" : gro,
"type" : gpm
}
$.ajax({
type : "POST",
url : "a.php",
data : param,
dataType: "json",
success : function (data) {}
});
//버튼클릭 이동
$(document).on("click", ".href", function () {
var hreft = $(this).attr("href");
if(hreft) document.location.href = hreft;
});
//새창
$(document).on("click", ".winhref", function () {
var hreft = $(this).attr("href");
if(hreft) window.open(hreft);
});
img class="winhref m_logcode" href='이동할주소'
[숫자 콤마 찍기]
return data.replace(/(\d)(?=(?:\d{3})+(?!\d))/g, '$1,');
[숫자 콤마 삭제]
return str.replace(/[^\d]+/g, '');
[주소복사] https://www.goodsweb.kr/?u=D419uEB5
SNS 알리기
핀터레스트
텔레그램로
블로그로
페이스북
트위터
카카오스토리
카톡 공유
관련 블로그
로딩중