Do these Javascript statements work?

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

  1. macrumors member

    #1
    if (document.form_name.parentNode == document.getElementById('name_of_id'))


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

    angelwatt

    #2
    Need more context.
     
  3. macrumors member

    #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

    #4
    Both halves of the if statement return a node element, so it should work.
     

Share This Page