Ticker

6/recent/ticker-posts

How to Make a Calculator on Your Blog


Go to the Blogger Layout Section and click on "add a gadget." Choose HTML/Javascript


Copy and paste the code below. 

<div class='clear'></div>
<div class='widget HTML' data-version='1' id='HTML5'>
<h2 class='title'>Tu calculadora</h2>
<div class='widget-content'>
<table border="0" bordercolor="#111111" id="AutoNumber1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%">

 <tbody><tr>
   <td width="33%"> </td>
   <td width="33%"><span style="font-size:78%;">
</span><div id="calc" class="drag">
 <form name="calculator">
   <table bordercolor=black" border="3" cellspacing="1" cellpadding="0" width="150" bgcolor="black">
     <tbody><tr>
       <td>

       <input style="color: white; background: black" length="19" name="ans" size="19" />
       </td>
     </tr>
   </tbody></table>
   <table bordercolor="gray" border="3" cellspacing="2" cellpadding="2" width="150" bgcolor="black">
     <tbody><tr>
       <td align="middle">
       <input onmousedown="document.calculator.ans.value+=&#39;7&#39;" value="  7  " name="seven" type="button" />
       </td>

       <td align="middle">
       <input value="  8  " name="eight" onclick="document.calculator.ans.value+=&#39;8&#39;" type="button" />
       </td>
       <td align="middle">
       <input value="  9  " name="nine" onclick="document.calculator.ans.value+=&#39;9&#39;" type="button" />
       </td>
       <td align="middle">
       <input value="  /  " name="divide" onclick="document.calculator.ans.value+=&#39;/&#39;" type="button" />
       </td>

     </tr>
     <tr>
       <td align="middle">
       <input value="  4  " name="four" onclick="document.calculator.ans.value+=&#39;4&#39;" type="button" />
       </td>
       <td align="middle">
       <input value="  5  " name="five" onclick="document.calculator.ans.value+=&#39;5&#39;" type="button" />
       </td>
       <td align="middle">

       <input value="  6  " name="six" onclick="document.calculator.ans.value+=&#39;6&#39;" type="button" />
       </td>
       <td align="middle">
       <input value="  *  " name="multiply" onclick="document.calculator.ans.value+=&#39;*&#39;" type="button" />
       </td>
     </tr>
     <tr>
       <td align="middle">
       <input value="  1  " name="one" onclick="document.calculator.ans.value+=&#39;1&#39;" type="button" />

       </td>
       <td align="middle">
       <input value="  2  " name="2" onclick="document.calculator.ans.value+=&#39;2&#39;" type="button" />
       </td>
       <td align="middle">
       <input value="  3  " name="three" onclick="document.calculator.ans.value+=&#39;3&#39;" type="button" />
       </td>
       <td align="middle">
       <input value="  -  " name="subtract" onclick="document.calculator.ans.value+=&#39;-&#39;" type="button" />

       </td>
     </tr>
     <tr>
       <td align="middle">
       <input value="  C  " name="clear" onclick="document.calculator.ans.value=&#39;&#39;" type="button" />
       </td>
       <td align="middle">
       <input value="  0  " name="zero" onclick="document.calculator.ans.value+=&#39;0&#39;" type="button" />
       </td>

       <td align="middle">
       <input value="  =  " name="equal" onclick="document.calculator.ans.value=eval(document.calculator.ans.value)" type="button" />
       </td>
       <td align="middle">
       <input value="  +  " name="add" onclick="document.calculator.ans.value+=&#39;+&#39;" type="button" />
       </td>
     </tr>
   </tbody></table>
 </form></div></td></tr></tbody></table></div></div>

Post a Comment

0 Comments