</SPAN></CODE></P><P><CODE><SPAN style="font-size:10.0pt;line-height:115%; mso-fareast-font-family:Calibri;mso-ansi-language:IN;mso-fareast-language:EN-US; mso-bidi-language:AR-SA"><!DOCTYPE html<BR><BR>PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"<BR><BR>"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><BR><BR><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><BR><BR><BR><head><BR><BR> <title>Studi Kasus_KALKULATOR</title><BR><BR></head><BR><BR><BR><body><BR><BR><BR> <script language="JavaScript" type="text/javascript"><BR><BR><!--<BR><BR>function getTextValue() {<BR><BR> var myForm = document.form1;<BR><BR> <BR><BR> var pil = myForm.opr.value<BR><BR> <BR><BR> <BR><BR> var Hasil;<BR><BR> if (pil == "*") { <BR><BR> Hasil = parseInt(myForm.op1.value) * parseInt(myForm.op2.value);<BR><BR> }<BR><BR> if (pil == "/") { <BR><BR> Hasil = parseInt(myForm.op1.value) / parseInt(myForm.op2.value);<BR><BR> }<BR><BR> if (pil == "+") { <BR><BR> Hasil = parseInt(myForm.op1.value) + parseInt(myForm.op2.value);<BR><BR> }<BR><BR> if (pil == "-") { <BR><BR> Hasil = parseInt(myForm.op1.value) - parseInt(myForm.op2.value);<BR><BR> }<BR><BR> <BR><BR><BR> myForm.hasil.value = Hasil;<BR><BR>}<BR><BR>//--><BR><BR></script><BR><BR><BR><form name="form1" action="#"><BR><BR><BR><input type="text" name="op1" size=10 /><BR><BR><BR><select name="opr"><BR><BR> <option value="*">*</option><BR><BR> <option value="/">/</option><BR><BR> <option value="+">+</option><BR><BR> <option value="-">-</option><BR><BR></select> <BR><BR><BR><input type="text" name="op2" size=10 /><BR><BR><BR><input type="button" value="=" onclick="getTextValue()" /><BR><BR><BR><input type="text" name="hasil" /><BR><BR><BR></form><BR><BR><BR></body><BR><BR></html></SPAN></CODE> <P class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; line-height:normal"><CODE><SPAN style="font-size:10.0pt;mso-fareast-font-family: Calibri">
0 komentar:
Posting Komentar