html - Read td values using prototype -


i read values of html td using prototype. example, have table follows

<table id="mytable">  <tr>     <td>apple</td>     <td>orange</td>     </tr>   <tr>     <td>car</td>     <td>bus</td>   </tr> </table> 

i read values - apple, orange, car , bus alone. unable find way it? of great help.

thanks, j

this should work:

var values = $$('#mytable td').collect(function(element) {   // striptags(), if you're interested in actual content   return element.innerhtml.striptags(); }); 

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -