Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Navigating the DOM

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