jquery - cross-browser solution for changing content of last li element -


i have following un-ordered list structure

<ul>   <li>coffee</li>   <li>tea</li>   <li>milk</li> </ul> 

now, need replace milk buttermilk, how can it, using jquery ofcourse? need solution, works on every browser, starting ie7+

use :last selector

$('li').filter(':last').text('buttermilk') 

Comments

Popular posts from this blog

javascript - Iterate over array and calculate average values of array-parts -

iphone - Using nested NSDictionary with Picker -

objective c - Newbie question -multiple parameters -