jquery last selector
Translation results:
last
英[lɑ:st] 美[læst]
n.last;end;last;shoe last (model for making shoes)
vt. Withstand; after...; enough; enough to maintain (especially for a certain period of time)
adj. The last; the nearest; the least likely; the only remaining one
vi.Continue
adv.Last; last time, most recent time
jquery last selectorsyntax
Function: :last selector selects the last element. Most common usage: Used with other elements to select the last element in a specified combination (like the example above).
Syntax: $(":last")
jquery last selectorexample
<html> <head> <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("p:last").css("background-color","#B2E0FF"); }); </script> </head> <body> <html> <body> <h1>Welcome to php中文网</h1> <p class="intro">php教程视频</p> <p>php手册</p> <p>php词典</p> <div id="choose"> Who is your favourite: <ul> <li>php教程视频</li> <li>php手册</li> <li>php词典</li> </ul> </div> </body> </html> </body> </html>
Run instance »
Click the "Run instance" button to view the online instance