jquery get method

the jquery $.get() method is used to get the dom elements matched by jquery object.

the jquery get method syntax :-

        $( selector ) .get ( index )
parameterdescription
indexoptional.integer value indicating which element to retrieve.start from zero

jquery get method example

               <script>
          
                   $(document).ready(function(){
                   
                   $("button").click(function(event){
                   
                   var x = $("li").get(1);
                   
                   alert("second li value is :--"+x.innerHTML);
                   
                        }); 
                         
                     }); 
                     
            </script>