티스토리 뷰

HTML/콤포넌트 모음

기타 등등 모음

트라이에이스 2023. 7. 3. 10:29

인풋 오류

<input id="text" type="text" aria-invalid="false" aria-errormessage="error" required>
<p id="error" role="alert" aria-live="assertive">오류입니다.</p>

인풋 aria-invalid="false" 를 true로 변경해준다.

<input type="password"  placeholder="" title="비밀번호를 다시 한 번 입력해 주세요">
<p id="text__password-error">비밀번호를 잘못 입력하였습니다.</p>

$('input').focus().attr('aria-describedby','text__password-error');

 

URL 가져오기

document.location.href.split('/').reverse()[1].replace('.', '');

 

오늘하루 열지 않기

// 쿠키 가져오기
var getCookie = function (cname) {
	console.clear()
	console.log(cname)
	var name = cname + "=";
	var ca = document.cookie.split(';');
	for(var i=0; i<ca.length; i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1);
		if (c.indexOf(name) != -1) return c.substring(name.length,c.length);
	}
	return "";
}
// 24시간 기준 쿠키 설정하기  
var setCookie = function (cname, cvalue, exdays) {
	var todayDate = new Date();
	todayDate.setTime(todayDate.getTime() + (exdays*24*60*60*1000));    
	var expires = "expires=" + todayDate.toUTCString(); // UTC기준의 시간에 exdays인자로 받은 값에 의해서 cookie가 설정 됩니다.
	document.cookie = cname + "=" + cvalue + "; " + expires;
	
}
$(document).ready(function(){
	var cookiedata = document.cookie;
	var $bottom_event = $("#bottom_event");

	if(cookiedata.indexOf("close=Y") < 0){
		$bottom_event.show();
	}else{
		$bottom_event.hide();
	}

	$bottom_event.find('.chkbox').on('click', function() {
		setCookie("close","Y", 1);   //기간( ex. 1은 하루, 7은 일주일)
		wylieLayer.close();
	});
});

'HTML > 콤포넌트 모음' 카테고리의 다른 글

모음1  (0) 2024.07.09
라디오 체크  (0) 2023.07.28
인풋 속성 정리  (0) 2023.03.28
원형차트  (0) 2021.12.28
웹접근성을 지키는 Swiper  (0) 2021.11.25
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/04   »
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
글 보관함