Solved

this.parentNode.name doesn't work in ff??

Posted on 2007-11-15
3
2,608 Views
Last Modified: 2012-08-13
This code works in ie, but not ff.

this.parentNode.id works in ff, but not this.parentNode.name

hmm  even alert(getElementById(this.parentNode.id).name); doesn't work in firefox


<div id="Div1" name="Div1-Name" style="display:block;">
  <input type="button" class="button" name="Save" value="Save" onClick="alert(this.parentNode.id);alert(this.parentNode.name);"/>
</div>

Open in new window

0
Comment
Question by:leos_
  • 2
3 Comments
 
LVL 25

Accepted Solution

by:
James Rodgers earned 250 total points
ID: 20292273
div does not have an attribute name, call id instead

<input type="button" class="button" name="Save" value="Save" onClick="alert(this.parentNode.id);alert(this.parentNode.id);">
0
 
LVL 25

Expert Comment

by:James Rodgers
ID: 20292297
0
 
LVL 3

Author Comment

by:leos_
ID: 20297228
Thanks.  Hard to believe, but it's true.

<div id="Div1" name="Div1-Name" style="display:block;" onclick="alert(this.name);">
      text
</div>
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question