MCQs > IT & Programming > DHTML > Which code snippets is more effective? Why is it so?

DHTML MCQs

Which of the following code snippets is more effective? Why is it so?

<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>

Answer

Correct Answer: The second code is more effective as it employs object caching

Explanation:

Note: This Question is unanswered, help us to find answer for this one

DHTML Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

DHTML Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it