Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jul 2002
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question enumerating items

    Hi,

    I would like to know if anyone has an idea on how to enumerate tags in NS4-6 and IE 4+? Tags like <div> or <layer>

    I used the following in IE, but in NS4+ I'm clueless...



    Value: <span id="Item1"><% =FormatCurrency(zNum1) %></span><span id="Item1Child" style="display:none"><% = ConvertCurrencyByLCID("CAD","USD",zNum1) %></span><img src="images/Spacer.gif" height="1" width="20"><img id="Item1Flag" src="images/flag_cdn.gif"><img src="images/Spacer.gif" height="1" width="20"><span id="Item1ConvertLabel" class="ex" onclick="javascript:ShowCurrency();">???</span><br>



    for (var i=0;i<=document.all.length;i++)
    {
    var e1 = document.all[a1+i];
    if (null!=e1)
    {
    if (zConversionLCID=="CAD") {e1.style.display = "";}
    else {e1.style.display = "none";}

    //e1.style.display = "none" == e1.style.display ? "" : "none";

    var e2 = document.all[a1+i+a2];
    if (null!=e2) e2.style.display = "none" == e1.style.display ? "" : "none"

    var e3 = document.all[a1+i+a3];
    if (null!=e3) e3.innerHTML = "none" == e1.style.display ? "Convert to CAD" : "Convert to USD";

    var e4 = document.all[a1+i+a4];
    if (null!=e4) e4.src = "none" == e1.style.display ? "images/flag_usa.gif" : "images/flag_cdn.gif";

    }

    }
    Last edited by Claudio; 07-04-2002 at 07:38 AM.

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Posts
    338
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    var els;
    if(document.all) els=document.all;
    else if(document.getElementsByTagName) els=document.getElementsByTagName("*");
    for (var i=0;i<=els.length;i++)
    {
    var e1 = els[a1+i];
    if (null!=e1)
    {
    if (zConversionLCID=="CAD") {e1.style.display = "";}
    else {e1.style.display = "none";}
    
    //e1.style.display = "none" == e1.style.display ? "" : "none";
    
    var e2 = els[a1+i+a2];
    if (null!=e2) e2.style.display = "none" == e1.style.display ? "" : "none"
    
    var e3 = els[a1+i+a3];
    if (null!=e3) e3.innerHTML = "none" == e1.style.display ? "Convert to CAD" : "Convert to USD";
    
    var e4 = els[a1+i+a4];
    if (null!=e4) e4.src = "none" == e1.style.display ? "images/flag_usa.gif" : "images/flag_cdn.gif";
    }
    }
    Hope that helps!

    Happy coding!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •