Javascript

swal() - 예쁜 알림창

HiroDaegu 2021. 12. 17. 00:10
728x90
SMALL

https://sweetalert.js.org/

 

SweetAlert

You've arrived! How lovely. Let me take your coat. Oops! Seems like something went wrong! Delete important stuff? That doesn't seem like a good idea. Are you sure you want to do that?

sweetalert.js.org

사용예시

	var importantLabel = $(".importantLabel");
			for(var i = 0; i < importantLabel.length; i++) {
				var val = $(importantLabel[i]).next("td").find("input");
				if(!val.length) {
					val = $(importantLabel[i]).next("td").find("select");
				}

				if(!val.val()) {
					swal({
						icon: "warning",
						title: "필수 값을 입력해주시길 바랍니다.",
						})
					val.focus();
					return false;
				}
			}
728x90
LIST