Zadaci Za Ispit - Web Alati I Programiranje

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 4

DIGITRON

<html>
<body>
<h3> Kalkulator </h3>
<script>

function addNum()
{
num1=parseInt(document.frmadd.txt1.value);
num2=parseInt(document.frmadd.txt2.value);
num3=num1+num2;
document.frmadd.txt3.value=num3;
}
function subNum()
{
num1=parseInt(document.frmadd.txt1.value);
num2=parseInt(document.frmadd.txt2.value);
num3=num1-num2;
document.frmadd.txt3.value=num3;
}
function mulNum()
{
num1=parseInt(document.frmadd.txt1.value);
num2=parseInt(document.frmadd.txt2.value);
num3=num1*num2;
document.frmadd.txt3.value=num3;
}
function divNum()
{
num1=parseInt(document.frmadd.txt1.value);
num2=parseInt(document.frmadd.txt2.value);
num3=num1/num2;
document.frmadd.txt3.value=num3;
}
</script>

<form name="frmadd">

Broj1<input type ="text" name="txt1" ><br>


Broj2<input type ="text" name="txt2" ><br>
Rezultat<input type ="text" name="txt3" disabled><br>

<input type="button" value="+" name"but1" onClick="addNum()">


<input type="button" value="-" name"but2" onClick="subNum()">
<input type="button" value="x" name"but3" onClick="mulNum()">
<input type="button" value="/" name"but4" onClick="divNum()">

</form>
</body>
</html>

...................................................................
...................................................................

BROJEVI OD 12
<html>
<body>
<h3> brojevi od 12 </h3>

<form name="forma">
<input type="text">
<br>
<input type="text">
<br>
<input type="text">
<br>
<input type="text">
<br>
<input type="text">
<br>
<input type="text">
<br>
<input type="text">
<br>
<input type="text">
<br>
<input type="text">
<br>
<input type="text">
<br>
<input type="button" value="Upisi brojeve" name"but" onClick="upisiBrojeve()">
</form>
<script>
function upisiBrojeve()
{
var j = 12;
for(var i = 0 ; i < 10 ; i++)
{
document.getElementsByTagName("input")[i].value = j;
j++;
}
}

</script>
</body>
</html>

......................................................................
......................................................................

BROJEVI OD 15 DO 100 DJELJIVI SA 7

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>

<style>
.container{
border: 1px solid #ccc;
padding: 10px;
width: 300px;
}

</style>

<script>

function ispisi()
{
brojac = 1;
for(var i = 15; i <= 100; i++){
if((i % 7 == 0) && brojac <= 10){
document.getElementById('id' + brojac).value = i;
brojac++;
}
}
}

</script>
</head>
<body>

<div class="container">

1.<input type="number" id="id1"></br>


2.<input type="number" id="id2"></br>
3.<input type="number" id="id3"></br>
4.<input type="number" id="id4"></br>
5.<input type="number" id="id5"></br>
6.<input type="number" id="id6"></br>
7.<input type="number" id="id7"></br>
8.<input type="number" id="id8"></br>
9.<input type="number" id="id9"></br>
10.<input type="number" id="id10"></br>
</br>
<button type="button" onclick="ispisi()">Ispi�i</button>

</div>

</body>
</html>

.....................................................................
.....................................................................

SPOJI RIJE�I

<html>
<body>
<span>Prva rijec:</span>
<input type="text"> �
<br> �
<span>Druga rijec</span>
<input type="text"> �
<p id="par"></p> � �
<button onclick="spoji()">Spoji</button> � � � � �
<script> � � �
function spoji() { � � � �
var inputi = document.getElementsByTagName("input"); � � �
var rijec = inputi[0].value +" "+ inputi[1].value; � � �
document.getElementsByTagName("p")[0].innerHTML=rijec; � � � �} �
</script>
</body>
</html>

.......................................................................
.......................................................................

DODAVANJE NOVOG ELEMENTA

https://jsbin.com/ruhufiwafo/edit?html,js,output

.......................................................................
.......................................................................

ELEMENTA A i B, POMJERANJE

https://jsbin.com/zokipiwiwu/edit?output

You might also like