HTML - calculadora

 
Vista:

calculadora

Publicado por felipe (1 intervención) el 30/10/2007 20:25:50
hola alguien me puede decir como hacer una calculadora en visual basic srcipt en HTML
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
Imágen de perfil de ScriptShow
Val: 359
Bronce
Ha mantenido su posición en HTML (en relación al último mes)
Gráfica de HTML

RE:calculadora

Publicado por ScriptShow (409 intervenciones) el 31/10/2007 19:34:47
Saludos, Felipe.

http://www.dynamicdrive.com/dynamicindex11/cal.htm
http://www.java-scripts.net/javascripts/Simple-Calculator.phtml
http://stud1.tuwien.ac.at/~e9125168/javas/jcalc.html

En fin..., hay miles; en JavaScript es más compatible que en VBScript.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<script language="javascript">
var inputstring=" "
function updatestring(value)
{
inputstring += value;
document.calculator.input.value=inputstring;
}
</script>
 
<center>
<table border=5 bordercolor=gray  cellspacing=8>
<form name="calculator">
<th>
THE CALCULATOR
</th>
<tr align="center">
<td>
<input type="text" name="input" maxlength=10 size=24>
</td></tr>
<tr align="center"><td>
<input type="button" value="  +  " onclick="updatestring('+')">
<input type="button" value="  -  " onclick="updatestring('-')">
<input type="button" value="  /  " onclick="updatestring('/')">
<input type="button" value="  *  " onclick="updatestring('*')">
</td></tr><tr align=center><td>
<input type="button" value="  mod  " onclick="updatestring('%')">
<input type="button" value="  0  " onclick="updatestring('0')">
<input type="button" value="  1  " onclick="updatestring('1')">
<input type="button" value="  2  " onclick="updatestring('2')">
</td</tr><tr align=center><td>
<input type="button" value="  3  " onclick="updatestring('3')">
<input type="button" value="  4  " onclick="updatestring('4')">
<input type="button" value="  5  " onclick="updatestring('5')">
<input type="button" value="  6  " onclick="updatestring('6')">
</td></tr><tr align="center"><td>
<input type="button" value="  7  " onclick="updatestring('7')">
<input type="button" value="  8  " onclick="updatestring('8')">
<input type="button" value="  9  " onclick="updatestring('9')">
</td></tr>
<tr align="center"><td>
<input type="button" value="  clear  " onclick="input.value=' ';inputstring=' ' ">
<input type="button" value="  =  " onclick="input.value=eval(inputstring);">
</td>
</tr>
</form>
</table>
</center>

Este te puede servir; puedes personaliza el aspecto con algunos cambios.

Si es algo más concreto, seguro que encontrarás en algún buscador cientos, tal vez, miles de enlaces.

Suerte.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:calculadora

Publicado por maria (1 intervención) el 15/04/2010 13:32:52
alguien puede decirme dónde puedo encontrar la html de una calculadora hipotecaria??? o bien el html o bien una página donde yo pueda hacerla.
llevo buscandola muchísimo tiempo y no tengo manera de encontrarla.

Gracias
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:calculadora

Publicado por elidel (1 intervención) el 21/10/2015 14:29:45
gracias por tu aporte al citio en verdad me sirvio mucho, espero consiga lo que busca
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:calculadora

Publicado por carlos (1 intervención) el 19/06/2008 22:17:19
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<HTML>
<HEAD>
 
<!-- Código descargado gratuitamente de HTMLpoint, el sitio italiano del web publishing
                                   http://www.htmlpoint.com -->
 
<TITLE>Demo Dynamic HTML: ejemplo práctico </TITLE>
 
 
</HEAD>
 
<BODY bgcolor="white" >
 
 
<CENTER>
<table border="2" width="200" cellspacing="0" cellpadding="0" bgcolor="#000000"
style="border-color:black" onClick="previouskey=event.srcElement.innerText">
  <tr>
    <td width="100%" bgcolor="#FFFFFF" id="result"
    style="font:bold 20px Verdana;color:black;text-align='right'">0</td>
  </tr>
  <tr>
    <td width="100%" valign="middle" align="center"><table border="0" width="100%"
    cellspacing="0" cellpadding="0" style="font:bold 20px Verdana;color:white">
      <tr>
        <td width="80%" align="center"><table border="1" width="100%" cellspacing="0"
        cellpadding="0" style="cursor:hand;font:bold 20px Verdana;color:white"
        onMouseover="if (event.srcElement.tagName=='TD')event.srcElement.style.color='yellow'"
        onMouseout="event.srcElement.style.color='white'" onselectStart="return false"
        onClick="calculate()" height="82">
          <tr>
            <td width="25%" align="center" height="17">7</td>
            <td width="25%" align="center" height="17">8</td>
            <td width="25%" align="center" height="17">9</td>
            <td width="25%" align="center" height="17">/</td>
          </tr>
          <tr>
            <td width="25%" align="center" height="19">4</td>
            <td width="25%" align="center" height="19">5</td>
            <td width="25%" align="center" height="19">6</td>
            <td width="25%" align="center" height="19">*</td>
          </tr>
          <tr>
            <td width="25%" align="center" height="19">1</td>
            <td width="25%" align="center" height="19">2</td>
            <td width="25%" align="center" height="19">3</td>
            <td width="25%" align="center" height="19">-</td>
          </tr>
          <tr>
            <td width="25%" align="center" height="19">0</td>
            <td width="25%" align="center" height="19"
            onClick="pn();previouskey=1;event.cancelBubble=true">+/-</td>
            <td width="25%" align="center" height="19">.</td>
            <td width="25%" align="center" height="19">+</td>
          </tr>
        </table>
        </td>
        <td width="20%"><div align="left"><table border="1" width="100%" cellspacing="0"
        cellpadding="0">
          <tr>
            <td width="100%" style="cursor:hand;font:bold 20px Verdana;color:white;text-align:center"
            onClick="result.innerText=0;results=''">C</td>
          </tr>
        </table>
        </div><div align="left"><table border="1" width="100%" cellspacing="0" cellpadding="0"
        height="81">
          <tr>
            <td width="100%" style="cursor:hand;font:bold 32px Verdana;color:white;text-align:center"
            onMouseover="event.srcElement.style.color='yellow'"
            onMouseout="event.srcElement.style.color='white'" onClick="calculateresult()">=</td>
          </tr>
        </table>
        </div></td>
      </tr>
    </table>
    </td>
  </tr>
</table>
 
<script language="JavaScript1.2">
 
 
var results=''
var previouskey=''
var re=/(/|*|+|-)/
var re2=/(/|*|+|-){2}$/
var re3=/.+(/|*|+|-).+/
var re4=/d|./
var re5=/^[^/*+].+d$/
var re6=/./

function calculate(){
if (event.srcElement.tagName=="TD"){
if (event.srcElement.innerText.match(re4)&&previouskey=="=")
results=''
if (result.innerText.match(re3)&&event.srcElement.innerText.match(re)){
if (!results.match(re5)){
result.innerText="Error!"
return
}
results=eval(results)
if (results.toString().length>=12&&results.toString().match(re6))
results=results.toString().substring(0,12)
result.innerText=results
}

results+=event.srcElement.innerText
if (results.match(re2))
results=results.substring(0,results.length-2)+results.charAt(results.length-1)

result.innerText=results
}
}

function calculateresult(){
if (!results.match(re5)){
result.innerText="Error!"
return
}
results=eval(results)
if (results.toString().length>=12&&results.toString().match(re6))
results=results.toString().substring(0,12)
result.innerText=results
}

function pn(){
if (result.innerText.charAt(0)!='-')
result.innerText=results='-'+result.innerText
else if (result.innerText.charAt(0)=='-')
result.innerText=results=result.innerText*(-1)
}

</script>
</CENTER>

</body>
</html>
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
sin imagen de perfil

calculadora

Publicado por Michel (1 intervención) el 26/09/2017 07:13:08
Hacer una calculadora en HTML y CSS
Podemos probar en nuestro navegador y veremos que tenemos una calculadora que no solo es funcional sino que tambien tiene un buen aspecto y muchos elementos para jugar con su diseño. Te invito a que hagas cambios en los estilos que hemos agregado y veas como cambia el diseño de la calculadora html.

Ver codigo completo HTML y CSS y descargar archivos: http://internetedadinero.com/hacer-una-calculadora-en-html/
Ver ejemplo: http://internetedadinero.com/calculadora-html/calculadora.html

Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar