I am new to javascript (just started to learn it) and want to make a
simple thing.
I would like to make a page with only one button and one variable that
is displayed. What I want to do is that variable is increased every
time button is pressed (and, of course, that increased value is
displayed than at screen, so it could be increased again), something
like:
<html>
<body>
<script type="text/javascript">
function add(number)
{
return (number+1)
}
number=0
document.write('<input type="button" onclick="add('number')"
value="+">')
document.write(number)
</script>
</body>
</html>
but this is not working.
Zeljko