Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

Navigating the DOM

  • 17-03-2006 09: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