Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>Title</title>
- </head>
- <script>
- function pomestiLevo() {
- var cifra = document.getElementById('pole').value;
- cifra=cifra.split('');
- for(var i =cifra.length ; i >=0 ; --i){
- var tmp=cifra[cifra.length-1];
- cifra[cifra.length-1]=cifra[i];
- cifra[i]=tmp;
- }
- for(i = cifra.length ; i >=1 ; --i){
- tmp=cifra[cifra.length-1];
- cifra[cifra.length-1]=cifra[i-1];
- cifra[i-1]=tmp;
- }
- cifra=cifra.join('');
- document.getElementById('pole').value = cifra;
- }
- function pomestiDesno() {
- var cifra = document.getElementById('pole').value;
- cifra = cifra.split('');
- for(var i = 0 ; i < cifra.length ; i ++) {
- var tmp = cifra[i];
- cifra[i] = cifra[cifra.length-1];
- cifra[cifra.length-1] = tmp;
- }
- for( i = 1 ; i < cifra.length ; i ++) {
- tmp = cifra[i-1];
- cifra[i-1] = cifra[cifra.length - 1];
- cifra[cifra.length - 1] = tmp;
- }
- cifra=cifra.join('');
- document.getElementById('pole').value=cifra;
- }
- function Convert() {
- var cifra = document.getElementById('pole').value;
- cifra=cifra.split('');
- for(var i = 0 ; i < cifra.length ; i++){
- if(cifra[i]<0){
- cifra[i]+=10;
- }
- else{
- cifra[i]-=2;
- }
- }
- cifra=cifra.join('');
- document.getElementById('pole').value = cifra;
- }
- function Proveri() {
- cifra=document.getElementById('pole').value;
- cifra=cifra.split('');
- var brojach = 0;
- for(var i = 0 ; i < cifra.length ; i ++){
- if(cifra[i]%3 ==0){
- brojach++;
- }
- }
- if(brojach>=3){
- document.write("sovrshen");
- }
- cifra=cifra.join('');
- document.getElementById('pole').value=cifra;
- }
- function Zacuvaj() {
- var cifra = document.getElementById('pole').value;
- var lista = document.getElementById('lista');
- var li = document.createElement('li');
- var text = document.createTextNode(cifra);
- li.appendChild(text);
- lista.appendChild(li);
- document.getElementById('pole').value="";
- }
- </script>
- <body>
- <input type="text" id="pole">
- <button onclick="pomestiLevo()"><</button>
- <button onclick="pomestiDesno()">></button>
- <button onclick="Convert()">CONVERT</button>
- <button onclick="Proveri()">CHECK</button>
- <button onclick="Zacuvaj()">STORE</button>
- <ul id="lista">
- </ul>
- </body>
- </html>
Add Comment
Please, Sign In to add comment