Skip to content

Module 3. JS Core. Lesson 12. Task 3. The Document Object Model. The HTML DOM Element addEventListener(), Event Object, Object handlers handleEvent, MouseEvent Object. Interactive Image Blocks. Setting the element's background image gotten from the URL

License

Notifications You must be signed in to change notification settings

iryna-romashko/JS-core-DOM-the-addEventListener-Event-Object-handleEvent-MouseEvent-Interactive-Image-Blocks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Module 3. JS Core. Lesson 12. Task 3

The Document Object Model. The HTML DOM Element addEventListener(), Event Object, Object handlers handleEvent, MouseEvent Object

Interactive Image Blocks. Setting the element's background image gotten from the URL

This repository contains a simple interactive web page that allows user to set custom images as backgrounds for different blocks. Each block serves as a customizable container where user can input image URLs, and the JavaScript functionality dynamically sets the background of the corresponding block.

Instructions

  1. Clone the repository:
git clone https://github.com/it-tinyangel/JS-core-DOM-the-addEventListener-Event-Object-handleEvent-MouseEvent-Interactive-Image-Blocks.git
  1. Open the index.html file in your browser.

Usage

  1. You'll see three interactive blocks on the page. Click on any block, and a prompt will ask you to enter the image URL for that specific block.
  2. If you provide a valid image URL, the block's background will be set to the chosen image.
  3. If you don't enter a URL or cancel the prompt, an alert will notify you to try again.

Customization

This code can serve as a starting point for experimenting with event-based styles or other projects based on this simple interactive image block concept.

Contributing

If you have suggestions or improvements, please open an issue or create a pull request. Contributions are welcome!

License

The source code is distributed under the MIT License. Detailed information about the license can be found in the file LICENSE

About

Module 3. JS Core. Lesson 12. Task 3. The Document Object Model. The HTML DOM Element addEventListener(), Event Object, Object handlers handleEvent, MouseEvent Object. Interactive Image Blocks. Setting the element's background image gotten from the URL

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published