Responsive Tip Calculator

Responsive Tip Calculator

The challenge

The challenge is to build out a tip calculator app and get it looking as close to the design as possible.

Users should be able to:

  • Calculate the correct tip and total cost of the bill per person

  • View the optimal layout for the app depending on their device's screen size

  • See hover states for all interactive elements on the page

Built with

  • HTML5

  • JavaScript

  • CSS

What I learnt

HTML DOM (Document Object Model)

  • A programmatic interface is provided that enables the creation, modification, or deletion of items within the document. Additionally, we have the capability to incorporate events into these sections in order to enhance the interactivity of our webpage.

    Used Dom Elements in my code

  • getElementById() method returns an element with a specified id.

  • addEventListener() method attaches an event handler to an specified .

  • setAttribute() method sets a new value to an attribute for the html element .

  • removeAttribute() method removes an attribute from an element.

Author