How to make eyes that follow the mouse in HTML
Code of index.html : <!DOCTYPE html> <html lang="en" dir="ltr"> <head> <meta charset="utf-8"> <link rel="stylesheet" href="style.css"> <title></title> </head> <body> <div class="eyes"> <div class="eye"> <div class="ball"></div> </div> <div class="eye"> <div class="ball"></div> </div> </div> <script> var balls = document.getElementsByClassName("ball"); document.onmousemove = function(){ var x = event.clientX * 100 / window.innerWidth + "%"; var y = event.clientY * 100 / window.innerHeight + "%"; //event.clientX => get the horizontal coordi...