Do these Javascript statements work?

Discussion in 'Web Design and Development' started by Jas123, Sep 11, 2010.

  1. macrumors member

    Joined:
    Apr 1, 2008
    #1
    if (document.form_name.parentNode == document.getElementById('name_of_id'))


    var a = document.form_name.id
     
  2. Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #2
    Need more context.
     
  3. thread starter macrumors member

    Joined:
    Apr 1, 2008
    #3
    Could I successfully determine if a particular div tag is the parent node of a particular form element with the first statement?
     
  4. Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #4
    Both halves of the if statement return a node element, so it should work.
     

Share This Page