February 2019 0 53 Report
Prosze o przerobienie podanego skryptu. Skrypt po podaniu liczby 0 w oknie pokazuje liczby parzyste i sa pokolorowane liczby, oraz skrypt po podaniu liczby 1 w oknie wyswietla liczby nieparzyste i sa pokolorowane liczby.

<html>
<head>
</head>
<body>
<script type="text/javascript">
document.write("<table border=\"2\">");
var x = 0;
var suma = 0;
for (i = 1; i <= 10 ; i++)
{
x = Math.floor(Math.random() * 100);
suma = suma+x;
if (x % 2 == 0){
document.write("<tr><td>" + i + "</td><td width=\"200\">"+x+"</td></tr>");}
else {document.write("<tr><td>" + i + "</td><td width=\"200\">"+x+"</td></tr>");}
}

document.write("<tr><td>Suma: </td><td width=\"200\"><b>"+suma+"</td></tr>");
document.write("</table>");
</script>
</body>
</html>



More Questions From This User See All

Recommend Questions



Life Enjoy

" Life is not a problem to be solved but a reality to be experienced! "

Get in touch

Social

© Copyright 2013 - 2024 KUDO.TIPS - All rights reserved.