John
John

Reputation: 4028

How to retrive the the table td value using jQuery

I want to get the value "Tokyo" in below table. https://jsfiddle.net/829qjjsw/

My javascript is

var MyRows = jQuery('gv-field-1-10').find('td').text();
alert(MyRows);

But it does not work.

Upvotes: 1

Views: 26

Answers (1)

fredrover
fredrover

Reputation: 3025

You forgot to put the dot before the name of the class. This should work:

var MyRows = jQuery('.gv-field-1-10').find('td').text();

Upvotes: 1

Related Questions