본문 바로가기

개발하자/자바스크립트

배열사용

<html>
 <head>
 <style type="text/css">
 </style>
<script>
</script>
 </head>
 <body>
<script>
a=["red","orange","yellow","green","blue","navy","purple"];
for(i=0;i<7;i++){
document.write("<input type=button value="+a[i]+">");
}
</script>
 </body>
</html>

'개발하자 > 자바스크립트' 카테고리의 다른 글

focus()  (0) 2015.02.07
지우기,복사  (0) 2015.02.07
주석  (0) 2015.02.07
1~100까지 10X10칸만들기(5의 배수표시)  (0) 2015.02.05
버튼색변경  (0) 2015.02.05