"TINKERMASTER " diseños para Photoshop

tinkermaster

Java Script10

[ Vista Previa ]




Informacion:
Nombre: Calculadora JS/HTML
Fecha: 16-01-2014


Calificanos:
 
[ Codigo ] 
Copia y pega [CTRL C + CTRL V] Por Encima de la Pagina o Extra Head

<!-- www.tinkermaster.es.tl -->

<script language="javascript">

function addChar(input, character){

if(input.value == null || input.value == "0")

input.value = character

else

input.value += character}

function deleteChar(input){

input.value = input.value.substring(0, input.value.length - 1)}

function changeSign(input){

if(input.value.substring(0, 1) == "-")

input.value = input.value.substring(1, input.value.length)

else

input.value = "-" + input.value}

function compute(form) {

form.display.value = eval(form.display.value)}

function square(form) {

form.display.value = eval(form.display.value) * eval(form.display.value)}

function checkNum(str) {

for (var i = 0; i < str.length; i++) {

var ch = str.substring(i, i+1)

if (ch < "0" || ch > "9") {

if (ch != "/" && ch != "*" && ch != "+" && ch != "-" 

&& ch != "(" && ch!= ")") {

alert("Hemos localizado un error, por favor revisa la operación.")

return false

}}}

return true}</script>

<form><table style="border:2px solid #cfcfcf;font-weight:bold;text-align:center;background:#E0F8EC;font-family:courier new;">

<tr><td colspan="4"><table style="border:0px;"><tr><td><center>

<input name="display" value="0" size="20" style="text-align:right;font-wight:bold;padding:3px;font-size:20px;">

</center></td></tr></table></td>

</tr><tr style="text-align:center;">

<td><input type="button" value="    7    " onClick="addChar(this.form.display, '7')"></td>

<td><input type="button" value="    8    " onClick="addChar(this.form.display, '8')"></td>

<td><input type="button" value="    9    " onClick="addChar(this.form.display, '9')"></td>

<td><input type="button" value="    /    " onClick="addChar(this.form.display, '/')"></td>

</tr><tr style="text-align:center;">

<td><input type="button" value="    4    " onClick="addChar(this.form.display, '4')"></td>

<td><input type="button" value="    5    " onClick="addChar(this.form.display, '5')"></td>

<td><input type="button" value="    6    " onClick="addChar(this.form.display, '6')"></td>

<td><input type="button" value="    *    " onClick="addChar(this.form.display, '*')"></td>

</tr><tr style="text-align:center;">

<td><input type="button" value="    1    " onClick="addChar(this.form.display, '1')"></td>

<td><input type="button" value="    2    " onClick="addChar(this.form.display, '2')"></td>

<td><input type="button" value="    3    " onClick="addChar(this.form.display, '3')"></td>

<td><input type="button" value="    -    " onClick="addChar(this.form.display, '-')"></td>

</tr><tr style="text-align:center;">

<td><input type="button" value="    0    " onClick="addChar(this.form.display, '0')"> </td>

<td><input type="button" value="    .    " onClick="addChar(this.form.display, '.')"> </td>

<td><input type="button" value="  +/-   " onClick="changeSign(this.form.display)"></td>

<td><input type="button" value="    +    " onClick="addChar(this.form.display, '+')"></td>

</tr><tr style="text-align:center;">

<td><input type="button" value="    (    " onClick="addChar(this.form.display, '(')"> </td>

<td><input type="button" value="    )    " onClick="addChar(this.form.display, ')')"> </td>

<td><input type="button" value="   sq    " onClick="if (checkNum(this.form.display.value)) { square(this.form) }"></td>

<td><input type="button" value="  <-    " onClick="deleteChar(this.form.display)"></td>

</tr><tr style="text-align:center;">

<td colspan="2"><input type="button" value="  RESULTADO  " name="enter" onClick="if (checkNum(this.form.display.value)) { compute(this.form) }"></td>

<td colspan="2"><input type="button" value="    LIMPIAR    " onClick="this.form.display.value = 0 "></td>

</tr></table></form>


Enlaces de ayuda
- Ver wallpapers para tu sitio [ Click aqui ]
- Ver diseños CSS para tu sitio [ Click aqui ]
- Ver Widgets para tu sitio [ Click aqui ]
- Ver recursos Javascript Avanzados para tu sitio [ Click aqui ]

Tags:


   
 

 
comments powered by Disqus
Hoy habia 10 visitantes (27 clics a subpáginas) ¡Aqui en esta página!

    • CUADRO TWEETS

      Para todos los usuarios de twitter que tienen una web es< esencial mantener informados a nuestros usuarios de las actualizaciones...

    • CUADRO DE NOTICIAS EN JQUERY

      crear un cuadro de noticias utilizando jquery para la animacion...

    • ESTILOS DE BORDES

      los bordes en realidad sirven para que algun elemento se vea mejor, es decir elegante...

    • RECURSOS

      encuentra exelentes paginas webs donde encontraras brushes, tipos de textos, etc...

  • SIGUEME EN YOUTUBE

    • DISEÑOS CSS

      descarga los mejores diseños Css para que puedas personalizar tu web...

    • PLANTILLAS XML

      Descarga exelentes plantillas para que personalizes tu blog...

    • JUEGOS PARA PC

      Descarga exelentes juegos para tu PC...

    • AFILIADOS VIP

      Afiliate a mi web de una manera facil y sencilla...

    • WALLPAPERS

      descarga wallpapers para que le den una mejor apariencia a tu PC...






    • Bienvenidos a Tinkermaster website en donde se comparten conocimientos, ideas e informaciones listas para que cualquiera pueda aprender de ellas - Diseñado Por Tinkermaster
      Estas viendo la imagen:


  • Este sitio web fue creado de forma gratuita con PaginaWebGratis.es. ¿Quieres también tu sitio web propio?
    Registrarse gratis