Unable to get value of the property getElementsBy TagName

Last Reply on Mar 07, 2012 08:26 AM By Mudassar

Posted on Mar 07, 2012 08:25 AM

    <script type="text/javascript" language="javascript">
        window.onload = function () {
            var rotator = document.getElementById("rotator");
            var images = rotator.getElementsByTagName("img");
            for (var i = 0; i < images.length; i++) {
                images[i].style.display = "none";
            images[0].style.display = "block";

            var counter = 0;
            setInterval(function () {
                for (var i = 0; i < images.length; i++) {
                    images[i].style.display = "none";
                images[counter].style.display = "block";
                if (counter == images.length) {
                    counter = 0;
            }, 3000);

    <td align="left" style="width:564px;height:235px; padding-bottom:20px;">
    <div id="rotator">
        <img src="images/banner.gif"  style="width:564px;height:235px;"/>
        <img src="images/de-ionizedwate.r1jpg.jpg"style="width:564px;height:235px;" />
        <img src="images/demineralizedwater.jpg" style="width:564px;height:235px;"/><img
            src="images/1exide.png" /><img src="images/1honda.png" /><img src="images/1honda1.png" />


Im using this code as you sugested i have written the script in master page and other thing in another page

i want to display the image only in 1 specific page but it is not working it is giving error if i click on another page

and the error is below

Microsoft JScript runtime error: Unable to get value of the property 'getElementsByTagName': object is null or undefined.

please suggest me something.


This question does not have replies that have been liked.
I agree, here is the link: https://www.e-iceblue.com/Introduce/spire-office-for-net-free.html