Back to feed
Renewal·서른의 생활코딩

Sample Source 2) JavaScript Basics (Exercise 2 with jQuery 02)

NS
normalstory
cover image

js 2_5 예제2_BY jquery 02



예제 2를 요즘 잘나간다던 jquery로 구현한다면?  2


<!DOCTYPE html>


<html>


<head>


<meta charset="UTF-8"/>


<title>예제2_BY jquery 02</title>


<script type="text/javascript" src="http://code.jquery.com/jquery-1.5.2.min.js"></script>




<script type="text/javascript">


//<![CDATA[


str = "<ul>";


for (i=1; i<=25; i++) {


str += "<li>" + i + "</li>";


}


str += "</ul>";


document.write(str);




$('ul > li').css("float","left");


$('ul > li').css("list-style","none");


$('ul > li').css("width","60px");


$('ul > li').css("height","60px");


$('ul > li').css("background-color","#dcdcdc");


$('ul > li').css("margin","1px");


$('ul > li').css("text-align","right");


$('ul > li').css("padding","1em .5em 0 0");


$('ul > li').css("font-size","1.2em");


$('ul > li').css("font-weight","bolder");




$('ul > li:nth-child(5n+1)').css("clear", "left");




//]]]]>


</script>


</head>


<body>


</body>


</html>

This English version was translated by Claude.

친절한 찰쓰씨
Written by
친절한 찰쓰씨

Pleasant Charles — UI/UX researcher at AIT. Keeping notes on design, planning, and slow days here since 2010.

More on the author's page

Keep reading

Renewal

Steadily, for the long haul, without burning out

Mar 31, 2026·9 min
Renewal

Tech-life balance

Feb 7, 2026·3 min
Renewal

Humanality, by Park Jeong-ryeol

Feb 7, 2026·11 min