if I don't want to use 'this' as an object and directly write the function without passing 'this' as an object and directly write this.src="" in the function why would that not work??
<body>
<script type="text/javascript">
function picture(yolo){
yolo.src="3Nail.jpg";
}
function normal(yolo) {
yolo.src="4Nail.jpg";
}
</script>
<img onmouseover="picture(this)" onmouseout="normal(this)" src="1nail.jpg" alt="n1"/>
<img onmouseover="picture(this)" onmouseout="normal(this)" src="2nail.jpg" alt="n2"/>
thiskeyword just means something different when it's in a different scope. That's why it doesn't work.thisin the event handler. Check out the MDN docs on thethiskeyword