Jump to content

mmehari

Members
  • Posts

    1
  • Joined

  • Last visited

Everything posted by mmehari

  1. Hello everyone, recently i am working on dynamic webdesign and i was trying to specifically access certain tags inside my page. This is the case, i have two paragraph tags with unique ids (i.e. "id_one" and "id_two") and child tags with similar names (i.e. "platform") <p id="id_one"><table><tr><td id="platform"></td></tr></table></p> <p id="id_two"><table><tr><td id="platform"></td></tr></table></p> What i would like to do is to insert content to the second paragraph td tag section.i have two functions named getChildByTagID(parentObj, childID) and getParentByTagName(parentTag) which will search through the page to find the child tag and parent tag accordingly. code section var parentNode = getParentByTagID("id_two");var platformNode = getChildByTagID(parentNode,"platform");document.getElementById(platformNode.id).innerHTML="Text check"; When i do execute the above code i see "Text check" in the first paragraph with id "id_one" not on the second paragraph all i want to is access the second paragraph td tag and write information to it. Thank you for the help,Michael Mehari
×
×
  • Create New...