Why is it not functioning properly? I would like to be able to click on next.jpg and have 2.png disappear while 1.png appears.
<html>
<head>
<script type="text/javascript">
function next(id)
{
var currentImg = document.getElementById('c' + id).style;
currentImg.display = 'none';
id++;
var newImg = document.getElementById('c' + id).style;
newImg.display = 'inline';
}
}
</script>
</head>
<body>
<img src="next.jpg" onclick="next(1)" >
<img id="c1" border="0" style="display: inline" src="2.png" usemap="#map2">
<img id ="c2" border="0" style="display: none" src="1.png" usemap="#map1">
........
UPDATE: Proper indentation of your code could help identify the error.