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

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -