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

actionscript 3 - TweenLite does not work with object -

php - How can I edit my code to echo the data of child's element where my search term was found in, in XMLReader? -

c# - Global Variables vs. ASP.NET Session State -