Click here to Skip to main content
13,259,194 members (52,429 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


1 bookmarked
Posted 18 Aug 2010

jQuery fetch last row

, 20 Aug 2010
Rate this:
Please Sign up or sign in to vote.
Fetch first column in last row of html Table
Scenerio: Accessing first td in last row of html table. Also you have to check the content(here need to search 'td1' text) in first td.


1. Add Link to Latest jQuery
<script type="text/javascript" src=""></script>

2. Html Table

Row1 td0Row1 td1
Row2 td1Row2 td1

3. JQuery Script for accessing last row in above table
Firt td containing 'td0', if it contains 'td0' alert message is appeared.

<script><br />
  $(document).ready(function(){<br />
	if($("#Mytable").find("tr:last td:eq(0)").text().indexOf('td1')!= -1)<br />
	    alert('Good Morining,You got td1');<br />
  });<br />

In Above script,

$("#Mytable").find("tr:last td:eq(0)").text().indexOf('td1')

Above line searchs text 'td1' in first column of last row in html table with id='Mytable'.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Web Developer
India India
This member doesn't quite have enough reputation to be able to display their biography and homepage.

You may also be interested in...

Comments and Discussions

GeneralReason for my vote of 5 good tip Pin
Pranay Rana20-Aug-10 0:59
memberPranay Rana20-Aug-10 0:59 
GeneralReason for my vote of 4 "Latest jQuery" should be http://co... Pin
Svetlin Panayotov19-Aug-10 22:06
memberSvetlin Panayotov19-Aug-10 22:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.171114.1 | Last Updated 20 Aug 2010
Article Copyright 2010 by YogeshRathod
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid