This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes cell value 'undefined' Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply locked New topic
Author

cell value 'undefined'

puja shaw
Ranch Hand

Joined: Nov 06, 2012
Posts: 32
the problem is that when i i am trying to get the cell value its showing 'undefined value'.What is the problem and how to get the value?





[code=html]

<html>
<form action="seecookies">
<table onClick="Clicking();">
<tr id="cookierow">
cookie value: mypassword
<td>+"mypassword"+</td>
cookie value: myUsername
<td>+"myUsername"+</td>
<script>
function Clicking(){
alert("infunction");
var row=document.getElementById("cookierow");
alert("infunction2");
var cells =
row.getElementsByTagName("td");
alert("infunction3");
alert("infunction4");
alert(cells.val());
alert("infunction5");}
</script>
</form>
</html>

[code]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
because td elements do not have values.

Eric
puja shaw
Ranch Hand

Joined: Nov 06, 2012
Posts: 32
Eric Pascarello wrote:because td elements do not have values.

Eric



next time when you point out the mistake ,kindly tell me where and how to solve it.Thankyou.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
puja shaw wrote:next time when you point out the mistake ,kindly tell me where and how to solve it.Thankyou.


Maybe next time I will not answer your question. Remember that we are helping you for free, so you get free advice.

If it was worded more like. "Thank you for pointing out my problem, can you please tell me how to to get the text of an element?"

I would be more inclined to tell you how.

Eric
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60765
    
  65

"puja shaw", please check your private messages for an important administrative matter. Thanks.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
Consider Paul's rocket mass heater.
 
subject: cell value 'undefined'
 
Similar Threads
send variable value from one servlet to another servlet for itext pdf
Data truncation: Truncated incorrect DOUBLE value:
A problem in hiding a button
unable to get form Parameters
How to call the servlet without form action