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
Post a Comment