This repository features a fun interactive JavaScript project where the "No" button on a webpage moves randomly when hovered over. This playful behavior is achieved by using the Math.random()
function to reposition the element each time the cursor moves over it.
- Interactive Element: The "No" button moves to a random location on the page when hovered over.
- JavaScript Fun: Uses JavaScript for real-time DOM manipulation with the
Math.random()
function to change the button's position.
- Clone the repository:
git clone https://github.com/nerdylelouch/interactive-javascript.git
- Open the
index.html
file in your browser to see the effect.
Simply move your cursor to the "No" button and watch it evade the mouse by jumping to a new random position.
You can modify the behavior by adjusting the CSS styles or the JavaScript logic in script.js
to suit your needs.
This project is open-source and available under the MIT License.
You can definitely use this as a fun way to apologise to your significant other, crush, or anyone you’ve got some explaining to do with. Just have the button "move away" as you try to get them to say "Yes"! It's a playful way to lighten the mood and add a bit of humor to your day.