jQuery(3)
-
JavaScript Forms & JS HTML DOM
Form validationdocument.forms["myForm"]["fname"].value;자바 스크립트는 입력의 유효성을 검사한다. 입력란이 공백이면 에러 메세지가 뜬다. 최소 100과 최대 300 사이의 숫자가 아니면 경고창이 뜬다. DOMIn the DOM, all HTML elements are defined as objects.A property is a value that you can get or set.A method is an action you can do var x = document.getElementById("main"); var y = x.getElementsByTagName("p"); document.getElementById("demo").innerHTML = 'Th..
2020.07.31 -
jquery
$("p").click(function(){$(this).hide();});마우스로 클릭하면 숨겨짐 $("p").dblclick(function(){ $(this).hide();});마우스로 더블 클릭하면 숨겨짐 $("#p1").mouseenter(function(){ alert("You entered p1!"); });p1에 마우스를 올리면 알림창이 뜸 $("#p1").mouseleave(function(){ alert("Bye! You now leave p1!"); });p1에 마우스를 떼면 알림창이 뜸 $("#p1").mousedown(function(){ alert("Mouse down over p1!");});The function is executed, when th..
2020.07.30 -
Java Script
String Lengthvar txt;varsln = txt.length; str.indexOfstr.lastIndexOfstr.search str.slicestr.substring negative index를 가질 수 없다 var fruits = ["Banana", "Orange", "Apple", "Mango"];fruits.sort():fruits.reverse(); new Date()new Date(year, month, day, hours, minutes, seconds, milliseconds)new Date(miliseconds)new Date(date string) Throw and Try to Catchp id="demo">/p>script>try { adddlert("Welcome ..
2020.07.27