Last active
January 28, 2016 13:55
-
-
Save MladenMladenov/3b0726d294dd4b9877bc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input{ | |
border:none; | |
background: #cfff99; | |
width: 200px; | |
height:50px; | |
margin-top:20px; | |
font-size:30px; | |
} | |
input:active{ | |
border:none; | |
box-shadow:black; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<input id="input" type="text" onChange="test();"/> | |
<input type="button" value="calculate" id="btn" onClick="calc(this)"/> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function test(){ | |
var input = document.getElementById("input").value; | |
var intinput = parseInt(input,10); | |
console.log(intinput); | |
return intinput; | |
} | |
function calc(functionval){ | |
var functionval = test(); | |
if(isNaN(functionval)){ | |
console.log("nan"); | |
return; | |
} | |
var newvalue = functionval*5; | |
for (i = 1; i <= 5; i+=1){ | |
console.log(newvalue); | |
} | |
} | |
///For circle area: | |
function test(){ | |
var input = document.getElementById("input").value; | |
var intinput = parseInt(input,10); | |
return intinput; | |
} | |
function calc(functionval){ | |
var functionval = test(); | |
if(isNaN(functionval)){ | |
console.log("nan"); | |
return; | |
} | |
var newvalue = functionval; | |
/*for (i = 1; i <= 5; i+=1){ } */ | |
console.log(Math.PI*Math.pow(newvalue,2)); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment