<!DOCTYPE html>
<html lang="tr">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
</head>
<style>
</style>
<body>
<input type="text" value="0" id="deger">
<button type="button" onclick="eylem()">Click Me</button>
<p id="result"></p>
<script type="text/javascript">
function eylem(){
var x= Number(document.getElementById("deger").value);
var text=" ";
var i;
for(i=0; i<=x; i++){
if(i%2==0){
continue;
}
text +=i+"<br>"
}
document.getElementById("result").innerHTML=text;
}
</script>
</body>
</html>
Hiç yorum yok:
Yorum Gönder