I am making a game in javascript and I needed help with the following:
I want to make an image = to a variable then I only want to show the image when I want it too.
So I want the image by default hidden but it is always showing whatever I do. I am only a beginner and I have looked at this page and others on the internet to help me: http://www.roseindia.net/javascript/javascriptexamples/javascript-hide-image.shtml
This is the code so far:
<html> <head></head>
<body>
<img src="http://wwcdn.weddingwire.com/static/vendor/55001_60000/56375/thumbnails/64x64_SQ_1342622451725-Matangiaerial.jpg"
id="islandimg">
<script type="text/javascript">
var playermoney = 10000;
var islandarray = new array;
var car = 500; var watch = 100;
var diamond = 2000;
function hideImage() {
if (document.getElementById) {
document.getElementById('islandimg').style.visibility = 'hidden';
}
</script>
</body></html>
The code has other stuff in it for the game but ignore it.
hideImage())