Get first and last value of ul li using jQuery

Today, We want to share with you Get first and last value of ul li using jQuery.In this post we will show you jQuery first() and last() functions example, hear for Remove li elements of ul except first and last in jQuery we will give you demo and example for implement.In this post, we will learn about How to get only the first list element in menu of unordered list in JQuery? with an example.

Get first and last value of ul li using jQuery

There are the Following The simple About jquery get last element of array Full Information With Example and source code.

As I will cover this Post with live Working example to develop jquery last-child with class, so the jquery insert after last child is used for this example is following below.

jQuery first() and last() functions example


<!DOCTYPE html>
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Get First and Last Element of li and option</title>
<script src=""></script>
$(function() {
//list-items example
    alert($("#aims li:first-child").text());
	alert($("#aims li:last-child").text());

//drop down example
	alert($("#information option:first-child").text());	
	alert($("#information option:last-child").text());	

<!-- list items -->
<ul id="aims">
	<li>dreams yuga</li>

<!-- Drop Down -->
<select id="information">

Web Programming Tutorials Example with Demo

Read :

Also Read This πŸ‘‰   How to get nth-child Selector using Jquery


You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about jquery last-child with class.
I would like to have feedback on my blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.