Home>> JQuery >>How to access data through jquery with function
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("button").click(function(){
//alert( $("div div:nth-child(4)").text());
alert( $("div div:nth-last-child(1)").text());
});
});
</script>
</head>
<body>
<button>Add and remove a property</button><br><br>
<div>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
</div>
</body>
</html>
![]()
Hello! I'm Krishan Kumar Singh author, .NET Framework and have more than 6+ years of hand over Microsoft .NET technologies.
|