PDA

View Full Version : Do these Javascript statements work?




Jas123
Sep 11, 2010, 02:12 PM
if (document.form_name[i].parentNode == document.getElementById('name_of_id'))


var a = document.form_name[i].id



angelwatt
Sep 11, 2010, 03:44 PM
Need more context.

Jas123
Sep 11, 2010, 03:52 PM
Could I successfully determine if a particular div tag is the parent node of a particular form element with the first statement?

angelwatt
Sep 11, 2010, 04:17 PM
Could I successfully determine if a particular div tag is the parent node of a particular form element with the first statement?

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