Is there any circumstances where the document.images collection would be empty, even though there are images on the page?
Here is the HTML:
And here is the JavaScript that I have so far in img.js:
For some reason this keeps telling me that the array is empty. Admittedly, I've never used this collection before, so I don't know how it works, but I can't find any documentation that says this can't be used this way.
Thanks for any help.
Here is the HTML:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/URL]
<html dir="ltr" xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Untitled 1</title>
<link href="Styles/main.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="img.js"></script>
</head>
<body>
<div class="Header" >
<img alt="Practice Management Services Inc." src="Images/LogoHeader.jpg" /></div>
<div class="NavBar">
<img src="Images/Buttons/Home.jpg"><img src="Images/Buttons/Clients.jpg" /></div>
<!-- #BeginEditable "body" -->
<div></div>
</body>
</html>
And here is the JavaScript that I have so far in img.js:
Code:
var imgCount = document.images.length;
For some reason this keeps telling me that the array is empty. Admittedly, I've never used this collection before, so I don't know how it works, but I can't find any documentation that says this can't be used this way.
Thanks for any help.