Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> การเขียนโปรแกรม

วิธีเขียน While Loop ในหน้า JSP


ตัวอย่าง While Loop ต่อไปนี้ -

<%! int fontSize; %> <html>    <head>       <title>WHILE LOOP Example</title>    </head>    <body>       <%while ( fontSize <= 3){ %>          <font color = "green" size = "<%= fontSize %>">             JSP Tutorial          </font><br />          <%fontSize++;%>       <%}%> </body> </html>

โค้ดข้างต้นจะสร้างผลลัพธ์ดังนี้ -

JSP Tutorial JSP Tutorial JSP Tutorial