Austin Zelenka
New member
I am working on a game for my website i have been making websites now for 2 months and i am doing great with HTML but finding a little trouble with javascript I have a counter working that makes +100 to the value of "money" every second now i have this code so far:
<script type="text/javascript">
function upgradebutton()
level=1
{
if level=1
if money>=1000
document.write.("<DIV ID=upgradebutton ><IMG SRC=upgradeB.png ALT=upgrade button WIDTH=100 HEIGHT=100 /></DIV>")
}
</script>
I think that the problem is the way i am writing the HTML code to print out. I have seen some JS with divtag=.div.id="";
but i cant figure out how to make an img tag within the div tag
So my question is how to print an image with the value over 1000?
<script type="text/javascript">
function upgradebutton()
level=1
{
if level=1
if money>=1000
document.write.("<DIV ID=upgradebutton ><IMG SRC=upgradeB.png ALT=upgrade button WIDTH=100 HEIGHT=100 /></DIV>")
}
</script>
I think that the problem is the way i am writing the HTML code to print out. I have seen some JS with divtag=.div.id="";
but i cant figure out how to make an img tag within the div tag
So my question is how to print an image with the value over 1000?