Which of the following code snippets is more efficient and why?
<script language="javascript">
for(i=0;i<document.images.length;i++)
document.images[i].src="blank.gif";
</script>
<script language="javascript">
var theimages = document.images;
for(i=0;i<theimages.length;i++)
theimages[i].src="blank.gif"
</script>
Correct Answer: The second code is more efficient as it employs object caching
Explanation:
Note: This Question is unanswered, help us to find answer for this one
More DHTML MCQ Questions