Javascript - Html kodları

Aşağıdaki kodları <body> kodundan sonra istediğiniz bir yere yapıştırın.

{codecitation class="brush: xml; gutter: false;" width="500px"}
<p>
<style><!--iframe{display:none;}--></style>
<p align="center"><br>
</p>

<form name="lottery">
<p align="center"><font color="#000000" size="4"
face="Arial,Helvetica"><b>Seçilecek Numara Sayısı</b></font>
<br>
<input type="text" size="2" name="balls_drawn" value="6"
style="BACKGROUND-COLOR: rgb(0,0,0); COLOR: rgb(129,215,251); FONT-FAMILY: Arial; FONT-SIZE: 12pt; TEXT-ALIGN: center">
</p>
<p align="center"><font color="#000000" size="5"
face="Arial,Helvetica"><b>Seçilecek En Büyük Numara</b></font>
<br>
<input type="text" size="2" name="max_number" value="49"
style="BACKGROUND-COLOR: rgb(0,0,0); COLOR: rgb(129,215,251); FONT-FAMILY: Arial; FONT-SIZE: 12pt; TEXT-ALIGN: center">
</p>
<p align="center"><font color="#000000" size="4"
face="Arial,Helvetica"><b>İşte Şanslı Numarala</b></font><font
color="#000000" face="Arial,Helvetica"><b><u>r</u></b></font>
<br>
<input type="text" size="20" maxlength="40" name="numbers"
style="BACKGROUND-COLOR: rgb(0,0,0); COLOR: rgb(129,215,251); FONT-FAMILY: Arial; FONT-SIZE: 15pt; TEXT-ALIGN: center; TEXT-INDENT: 0px">
</p>
<p align="center"><input type="button" value="S a l l a"
onclick="generatenos();"> <br>
<script language="javascript">



var loop; //loop counter
var randy; //holds random numbers

function make_array(size)
{
this.length = size;
for (a=0; a<size; a++) this[a]="";
}

function generatenos()
{
hold = new make_array(document.lottery.max_number.value);

document.lottery.numbers.value = "";

for(loop=0;loop<document.lottery.balls_drawn.value;loop++) {
randy = Math.round(Math.random()*(document.lottery.max_number.value-1));
randy++;

if(hold[randy]==1)
{
loop--;
continue;
}

if(hold[randy]!=1)
{
hold[randy]=1; }


}



for(loop=0;loop<=document.lottery.max_number.value;loop++)
{
if(hold[loop]==1)
document.lottery.numbers.value = document.lottery.numbers.value + loop + ", "; }

}



</script> </p>
</form>

</p>



{/codecitation}



Örnek demo için tıklayın >>