Posted by David Graham on 02/27/06 12:41
"Toby Inkster" <usenet200602@tobyinkster.co.uk> wrote in message
news:porad3-809.ln1@ophelia.g5n.co.uk...
> senhortomas wrote:
>
> > Can html perform interactively or make decisions?
>
> No -- you'd need either a server-side or client-side programming language.
>
> ECMAScript (a.k.a. Javascript) is really the only client-side scripting
> language in town. Here's an example of something you could do with it:
>
> <script type="text/javascript">
> function sum ()
> {
> var A = document.getElementById('a');
> var B = document.getElementById('b');
> var C = document.getElementById('c');
> C.value = A.value + B.value;
> }
> </script>
> <div>
> <input id="a"> +
> <input id="b">
> <input type="button" onclick="sum();" value="=">
> <input id="c">
> </div>
>
Hi Toby
I just ran the javascript you posted to see it work. When I put in 4 + 3 I
get an answer of 43 - is that what you intended?
bye
David
[Back to original message]
|