Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Navigating the DOM

  • 17-03-2006 10:02PM
    #1
    Closed Accounts Posts: 201 ✭✭


    I am trying to navigate the DOM in Mozilla Thunderbird with a DOM inspector extension and I have identified an element and the node I want to change now its id is priorityCol but when I try to access it like this

    document.getElementById("priorityCol").firstNode.nodeValue="false";

    says that document.getElementById("priorityCol") has no properties???

    Anyone any ideas where may be going wrong the id is definitely right!


Comments

  • Registered Users, Registered Users 2 Posts: 1,275 ✭✭✭bpmurray


    Actually, you need to be careful with getElementById. Try this instead ...
    if (window.document.getElementById != null)
       myDomObj = window.document.getElementById("priorityCol");
    else if (window.document.all != null) 
       myDomObj = window.document.all("priorityCol");
    


  • Closed Accounts Posts: 201 ✭✭bazcaz


    No neither of them worked does it matter what level of the DOM I am at like theres a nice hierarchy from document down to this element in DOM Inspector


  • Closed Accounts Posts: 201 ✭✭bazcaz


    Ive sorted it was

    window.document.getElementById("priorityCol").getAttributeNode("hidden").value=false;


Advertisement