getting content of TAG object returned by getElementsByTagName("*")

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • devabratkumar
    New Member
    • Apr 2008
    • 1

    getting content of TAG object returned by getElementsByTagName("*")

    Hi

    getElementsByTa gName("*")

    returns an array of objects which are tags present in the document

    for eg, var a=getElementsby TagName("*") ;

    'a' would be an array of Tag objects
    a[i].nodeName gives the name of the tag eg, IMG,SCRIPT, etc
    where i>0

    I need a method which would give me the entire content of the Tag
    eg. if a tag, say ,'script' has following content

    <SCRIPT src="http://10.102.24.121/cvpn/http/10.102.93.93/exchange/Administrator/?cmd=script&tem plate=loc_note& cache=1&ver=6.5 .7638.1"></SCRIPT>

    then i need the entire stuff ie
    """src="htt p://10.102.24.121/cvpn/http/10.102.93.93/exchange/Administrator/?cmd=script&tem plate=loc_note& cache=1&ver=6.5 .7638.1"""

    Please suggest me a method (function) which could give me the content of Tag object returned by getElementByTag Name

    --thanks
    devabrat kumar
    [removed email]
    Last edited by acoder; Apr 9 '08, 01:49 PM. Reason: removed email
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Welcome to bytes.com!

    If you just want the attributes, you can access them using a[i].src (just check that the attribute is defined before using it).

    Comment

    Working...