Hi makenzi.exc,
Refer below example.
HTML
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<style type="text/css">
body { font-family: Arial; font-size: 10pt; }
</style>
</head>
<body>
<div id="message1">Welcome to</div>
<hr />
<div id="message2">ASPSnippets</div>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script type="text/javascript">
$(function () {
// jQuery on.
$('#message1').on('click', function () {
$(this).css('color', 'red');
})
// jQuery bind.
$('#message2').bind('click', function () {
$(this).css('color', 'purple');
});
});
</script>
</body>
</html>
Demo
Screenshot

Downloads
Download Sample