We can access the HTML elements by name in jQuery very easy easily as compared to the simple JavaScript.
<script type="text/javascript">
$("button").click(function()
{
$("button").css("color","red");
});
</script>
$("TagName")
$("button").eq(1).css("color","red");
Index will start from 0.
Using $(this)
we will select the current clicked Element.<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<button> First Button </button>
<button> Second Button </button>
<script type="text/javascript">
$("button").click(function()
{
$(this).css("color","red");
});
</script>