kalkulators no Ambex

mail@pastecode.io avatar
unknown
abc
2 years ago
746 B
4
Indexable
Never
<style>
body
{
    background: url(https://images.pexels.com/photos/374918/pexels-photo-374918.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1);
    background-position: center center;
    background-size: cover;
    
    color: white;
}

</style>

<script>

function manafunkcija()
{
    let skaitlis1 = document.querySelector("#skaitlis1").value;
    let skaitlis2 = document.querySelector("#skaitlis2").value;
    
    let rezultats = Number(skaitlis1) + Number(skaitlis2);
    
   document.querySelector("#rezultats").value = rezultats;
    
}

</script>
<h1>Saskaitīšanas kalkulators</h1>

<input id= 'skaitlis1'>
+ 
<input id= 'skaitlis2'> 
= 
<input id= 'rezultats'>

<input type='button' value='Aprēķināt' onclick="manafunkcija()">