This javascript square root calculator is used to calculate square root of a number. This squareroot calculator is for free use.
Features
a) You can calculate square root of any number using this javascript calculator.
b) This is a free square root calculator.
c) Just copy the code and use it.
Preview
Square root-Calculator
Code
<!-- Script by hscripts.com -->
<script type="text/javascript">
function sqr(num)
{
var no=parseFloat(num.value);
if(isNaN(no))
{
alert("Please Enter Numbers Only");
num.value="";
document.frm.res.value="";
num.focus();
}
else
{
document.frm.res.value=Math.sqrt(no).toFixed(2);
}
}
function incheck(event,no)
{
var kc;
if(window.event)
{
kc=event.keyCode;
}
else
{
kc=event.which;
}
var num=no.value;
if(kc==46)
{
if(num.indexOf(".")==-1)
{
return true;
}
else
{
return false;
}
}
if(kc==48)
{
if(num.indexOf("-")==0 && num.length==1)
{
return false;
}
if(num=="")
{
return false;
}
else
{
return true;
}
}
if (kc!=8 && kc!=0)
{
if (kc<49||kc>57)
{
return false;
}
}
}
</script>
<!-- Script by hscripts.com -->
- The javascript (misspelled as java script) is given under GPL License
- i.e. Free use for those who use the codes as it is.
- Free, if your modification does not remove our copyright information and links.
- Click Here for detailed license information.
- You can purchase the script if your requirements does not meet our GPL License terms.