Here is what I want to do but with another um... technique/method. The first one is working, the second is not:
<script>
function hello(){
var number = document.getElementById("omg").innerHTML;
if(number==undefined){
number=0;
}
number++;
document.getElementById("omg").innerHTML=number;
}
</script>
<input type="submit" value="yeah" onclick="hello()">
<div id="omg"></div>
Here is the way that I want to do it, the technique that I want to use but its not working.
<script>
function hello(){
var number;
if(number==undefined){
number=1;
}
document.getElementById("omg").innerHTML=number;
number++;
}
<input type="submit" value="yeah" onclick="hello()">
<div id="omg"></div>
Instead of taking the last value from the div I want to like take it from a string in the function. So the point is that each time I click the button the number increases by one.