전체글 (354) 썸네일형 리스트형 innerHTML innerHTML을 이용하여 html 콘텐츠 동적 변경 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 Document function change() { var p =document.getElementById("firstP"); p.innerHTML = "나의 강아지" target="_blank" rel="noopener">puppy.png'>강아지"; } 여기에 클릭하세요. http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter http://colorscripter.com/info#e" target="_blank" s.. CSS 동적변경 getElementById() See the Pen WNvMopx by MoonSeonhyeon (@Seonhyeon) on CodePen. HTML 태그 요소 5가지! See the Pen ZEGrBBJ by MoonSeonhyeon (@Seonhyeon) on CodePen. 통장 See the Pen rNVJMbm by MoonSeonhyeon (@Seonhyeon) on CodePen. String 객체 사용하기 charAt() concat() slice() toUpperCase() replace() .split() 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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 Document String 객체 사용하기 var a = new String("Boys and Girls"); var b = "!!";//String 만 유일하게 new 없이 사용가능 //문자열 - 문자(한개의 단어) document.writeln(a.charAt(0)+" "); //concat메소드는 가변인수.. Date 객체 사용하기 See the Pen xxGYEpr by MoonSeonhyeon (@Seonhyeon) on CodePen. Math 객체 만들기 수학 계산을 위한 프로퍼티와 메소드 제공 new Math()로 객체 생성하지 않고도 사용 Math 객체의 메소드 random() floor() 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 31 32 33 34 Document //랜덤하게 1~9까지 리턴하는 함수만들기 function randomInt(){ return Math.floor(Math.random()*9)+1; } Math 객체 만들기 var q = randomInt() + "*" + randomInt(); var u = prompt(q + "값은 얼마입니까?", "0"); //취소를 클릭하면 u값은 null이 된다. if(u==null){ d.. 배열 Array(예시 평균 온도 구하기, 배열 다음 for문) 평균 온도 구하기 See the Pen VwLQKLz by MoonSeonhyeon (@Seonhyeon) on CodePen. 배열 다음 for문 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 package myapp; public class Ex2 { public static void main(String[] args) { // 배열 : 동일한 타입의 값들을 하나의 변수 사용하기 위한 목적(아파트) int arr[] = {1,2,3,4,5}; System.out.println(arr[0]); System.out.println(arr[1]); //배열 밑에는 항상 for가 있다(JSPStudy) for (int i = 0; i cs 이전 1 ··· 36 37 38 39 40 41 42 ··· 45 다음