I have the following code
<!DOCTYPE html>
<html>
<body>
<p id="demo">Demo Element</p>
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script>
$('#demo').click(() => {
console.log(this)
})
</script>
</body>
</html>
When I click the #demo paragraph, this
returns the window object. Why does this happen and how can I not access the #demo paragraph using this method.