Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

cell value 'undefined'

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
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]
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
because td elements do not have values.

Eric
 
puja shaw
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator

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
Posts: 15385
6
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator

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
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
"puja shaw", please check your private messages for an important administrative matter. Thanks.
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic