answersLogoWhite

0


Best Answer

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<HTML xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/HTML; charset=UTF-8" />

<title>Untitled Document</title>

<link href="lightbox-styles.css" rel="stylesheet" type="text/css" />

<script language="javascript" type="text/javascript">

function currencyFormat(fld, milSep, decSep, e) {

var sep = 0;

var key = '';

var i = j = 0;

var len = len2 = 0;

var strCheck = '0123456789';

var aux = aux2 = '';

var whichCode = (window.Event) ? e.which : e.keyCode;

if (whichCode 3) {

aux2 += milSep;

j = 0;

}

aux2 += aux.charAt(i);

j++;

}

fld.value = '';

len2 = aux2.length;

for (i = len2 - 1; i >= 0; i--)

fld.value += aux2.charAt(i);

fld.value += decSep + aux.substr(len - 2, len);

}

return false;

}

function deleteChar(Input)

{

Input.value = Input.value.substring(0, Input.value.length - 1);

}

function validate()

{

var n=document.Calc.Input.value; //Get the value of textbox into variable

if (n<0.1 n >10) {

alert("Please enter a value in the range of 0.1 to 10.0 ml/sec");

document.Calc.Input.value='';

}

else {

document.getElementById('displ').value = document.getElementById('junk').value;

document.getElementById('light1').style.display='none';

document.Calc.Input.value='';

document.getElementById('fade1').style.display='none';

}

}

</script>

</head>

<body>

<p><a href="javascript:void(0)" onclick = "document.getElementById('light1').style.display='block';document.getElementById('fade1').style.display='block';document.Calc.Input.value='';"><input type="text" id="displ" readonly="readonly" /></a></p>

<div id="light1" class="white_content">

<form name="Calc">

<div>

<input type="text" name="Input" id="junk" size="16" onkeypress="return(currencyFormat(this,',','.',event))" />

<input type="button" id="backspace" value="Backspace" onclick="deleteChar(this.form.Input)" />

</div>

<div class="first">

<input type="button" name="one" VALUE=" 1 " Onclick="Calc.Input.value += '1'">

<input type="button" name="two" VALUE=" 2 " Onclick="Calc.Input.value += '2'">

<input type="button" name="three" VALUE=" 3 " Onclick="Calc.Input.value += '3'">

</div>

<div class="second">

<input type="button" name="four" VALUE=" 4 " Onclick="Calc.Input.value += '4'">

<input type="button" name="five" VALUE=" 5 " Onclick="Calc.Input.value += '5'">

<input type="button" name="six" VALUE=" 6 " Onclick="Calc.Input.value += '6'">

</div>

<div class="third">

<input type="button" name="seven" VALUE=" 7 " Onclick="Calc.Input.value += '7'">

<input type="button" name="eight" VALUE=" 8 " Onclick="Calc.Input.value += '8'">

<input type="button" name="nine" VALUE=" 9 " Onclick="Calc.Input.value += '9'">

</div>

<div class="fourth">

<input type="reset" name="cancel" VALUE="Cancel" Onclick="Calc.Input.value += ''">

<input type="button" name="zero" VALUE=" 0 " Onclick="Calc.Input.value += '0'">

<input type="button" name="enter" VALUE="Enter" Onclick="validate();">

</div>

</form><a href = "javascript:void(0)" onclick = "document.getElementById('light1').style.display='none';document.getElementById('fade1').style.display='none'">Close</a></div>

<div id="fade1" class="black_overlay"></div>

</body>

<!-- honey -->

</HTML>

User Avatar

Wiki User

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

13y ago

done by Nadia Sawda and Syed Erfan Habib

<html>

<form>

<head>

<script type="text/javascript">

var temp2=0;

var num=0;

var y=0;

var temp4=0;

var j=11;

var flag=10;

var temp8=0;

var temp7=0;

var val=0;

var k=99;

function input(x)

{

if(k==0)

{

var temp=document.getElementById("r").value+=x;

temp2=parseFloat(temp);

}

}

function of()

{

if(j==0)

{

temp2=0;

temp3=1;

temp7=0;

flag=10;

document.getElementById("r").value="0";

j=1;

k=0;

}

else

{

temp2=0;

temp3=1;

temp7=0;

flag=10;

document.getElementById("r").value="";

j=0;

k=1;

}

}

function ac()

{

if(k==0)

{

temp2=0;

temp7=0;

temp3=1;

flag=10;

document.getElementById("r").value="0";

}

}

function add()

{

if(k==0 && flag!=4 && flag!=5 && flag!=6)

{

temp7=parseFloat(temp2)+parseFloat(temp7);

document.getElementById("r").value="";

flag=0;

}

if(k==0 && flag==4)

{

document.getElementById("r").value="";

flag=0;

}

if(k==0 && flag==5)

{

document.getElementById("r").value="";

flag=1;

}

if(k==0 && flag==6)

{

document.getElementById("r").value="";

flag=1;

}

}

function minus()

{

if(k==0 && flag!=4 && flag!=5 && flag!=6)

{

temp7=parseFloat(temp7)+parseFloat(temp2);

document.getElementById("r").value="";

flag=1;

}

if(k==0 && flag==4)

{

document.getElementById("r").value="";

flag=0;

}

if(k==0 && flag==5)

{

document.getElementById("r").value="";

flag=1;

}

if(k==0 && flag==6)

{

document.getElementById("r").value="";

flag=1;

}

}

function multip()

{

if(k==0)

{

temp7=temp2;

document.getElementById("r").value="";

flag=2;

}

}

function divis()

{

if(k==0)

{

temp7=temp2;

temp2=document.getElementById("r").value="";

flag=3;

}

}

function point()

{

if(k==0)

{

temp2=document.getElementById("r").value+=".";

}

}

function equal()

{

if(flag==0 flag==4)

{

if(k==0)

{

document.getElementById("r").value="";

temp7=document.getElementById("r").value=parseFloat(temp7) + parseFloat(temp2);

flag=4;

}

}

if(flag==1 flag==77)

{

if(k==0)

{

document.getElementById("r").value="";

temp7=document.getElementById("r").value=parseFloat(temp7) - parseFloat(temp2);

flag=77;

}

}

if(flag==2 flag==5)

{

if(k==0)

{

num=temp7;

temp7=document.getElementById("r").value=parseFloat(temp7) * parseFloat(temp2);

flag=5;

}

}

if(flag==3 flag==6)

{

if(k==0)

{

num=temp7;

temp7=document.getElementById("r").value=parseFloat(temp7) / parseFloat(temp2);

temp8=temp7;

flag=6;

}

}

}

function displayDate()

{

document.getElementById("d").value=Date();

document.getElementById("yr").value= " 2011";

var today=new Date();

var h=today.getHours();

var m=today.getMinutes();

var s=today.getSeconds();

m=checkTime(m);

s=checkTime(s);

document.getElementById('t').value=h+":"+m+":"+s;

tm=setTimeout('displayDate()',500);

}

function checkTime(i)

{

if (i<10)

{

i="0" + i;

}

return i;

}

</script>

<style type="text/css">

table, td, th

{

border:10px solid black;

}

td

{

background-color:black;

color:black;

}

</style>

</head>

<body>

<form>

<center>

<table border="10" bgcolor="red">

<tr>

<td>

<input type="text" size="13" maxlength="10" id="r" name="r" disabled="disabled" readonly="readonly">

/>

</td>

<td>

<input type="button" onclick="ac()" size="5" value=" C " />

</td>

<td>

<input type="button" onclick="of()" value=" On/OFF " />

</td>

</tr>

<tr>

<td>

<center>

<input type="button" onclick="input(1)" size="5" value="1" />

<input type="button" onclick="input(2)" size="5" value="2" />

<input type="button" onclick="input(3)" size="5" value="3" />

</center>

</td>

<td>

<center>

<input type="button" onclick="add()" size="5" value="+" />

</center>

</td>

<td>

<center>

<input type="text" size="8" id="d" name="d" disabled="disabled" readonly="readonly" />

</center>

</td>

</tr>

<tr>

<td>

<center>

<input type="button" onclick="input(4)" value="4" />

<input type="button" onclick="input(5)" value="5" />

<input type="button" onclick="input(6)" value="6" />

</center>

</td>

<td>

<center>

<input type="button" onclick="minus()" value="-" />

</center>

</td>

<td>

<center>

<input type="text" size="8" id="yr" name="yr" disabled="disabled" readonly="readonly" />

</center>

</td>

</tr>

<tr>

<td>

<center>

<input type="button" onclick="input(7)" value="7" />

<input type="button" onclick="input(8)" value="8" />

<input type="button" onclick="input(9)" value="9" />

</center>

</td>

<td>

<center>

<input type="button" onclick="multip()" value="*" />

</center>

</td>

<td>

<center>

<input type="text" size="8" id="t" name="t" disabled="disabled" readonly="readonly" />

</center>

</td>

</tr>

<tr>

<td>

<center>

<input type="button" onclick="input(0)" value="0" />

<input type="button" onclick="point()" value=" . "/>

<input type="button" onclick="equal()" value=" = " />

</center>

</td>

<td>

<center>

<input type="button" onclick="divis()" value=" / " />

</center>

</td>

<td>

<center>

<input type="button" onclick="displayDate()" value=" Date " />

</center>

</td>

</tr>

<table>

</center>

</form>

</body>

</html>

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

This easy-to-use computer language can be self-taught. Besides going to a bookstore and buying a book on it or hiring someone to write it for you, there are sites you can visit that offer tutorials on using this language to write Web pages, and plenty of examples you can play with.

Search the Web for "javascript tutorial" (without the quotes) and the first page of results will have plenty of starting points for you.

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

You cannot make a scientific calculator which will do calculations using pure HTML. HTML is not a programming language, so it only for laying out and formatting things. So you could design the look of it, like the buttons and display, but to make it actually calculate you will need some programming language and build that into the web page.

This answer is:
User Avatar

User Avatar

Wiki User

9y ago

You can perform calculation by simple operators. You have to do all of that by defining a function().

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you perform the calculation by java script?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Does a java script operator perform mathematical operation on 2 numbers?

some times


What is java fx2.1.1?

Java script


Is Java script needed for Poptropica?

No, Java script is not needed to play poptropica.


Does Java Script use the same compiler as Java?

No


How much 2 stroke do you put in five liters or gas?

Here is a site with a Java Script calculation that should help. http://www.csgnetwork.com/oilfuelcalc.html Hope This Helps.


Where can I download java script free?

When it comes to java script you can simply download it free from the java website. You can also go to CNET downloads and get it free from there.


Does java script coding mean using it for Java programs only?

Java script coding is computer coding, many things require Java, and you need to have Java enabled to view these types of programs.


Does iPod touches have java script?

they have java&lt; javascript and flash


Which script based on sound?

Java script is based on sound.


Do you have Java script installed on this computer?

No


Who is the implementor for java script?

ECMASCRIPT5


Is the Kindle written in java script?

no