Giter Site home page Giter Site logo

shivaniagrawal14 / salestaxcalculator Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 67 KB

I write a very simple HTML and CSS UI for a sales tax calculator web application with the addition of some simple JavaScript behaviors to my HTML/CSS file which will enable the buttons to work and calculate the tax and total for you.

HTML 77.46% CSS 22.54%

salestaxcalculator's Introduction

Sales Tax Calculator

A calculator which calculates sales tax and tax rate with a minimalist design.

image

What is this and How it is created?

I write a very simple HTML and CSS UI for a sales tax calculator web application with the addition of some simple JavaScript behaviors to my HTML/CSS file which will enable the buttons to work and calculate the tax and total for you.

  • Use the included wireframe mockup as a guide to what components should be in the app UI and a general layout.

  • UI needs a form with 4 text inputs and the appropriate labels and text instructions. There needs to be two buttons, use html button elements.

  • The sales tax and total input boxes are disabled so a user cannot type in any values.

  • Added a <script> tag section at the end of body section in the HTML page for the JavaScript.

  • Added three event handlers (functions). One will be for the calculate button, one will be for the clear button, and one will setup and bind the event handlers to the buttons when the page loads.

  • Defined an event handler function that will be connected to the calculate button. This is where I should do all my calculations and then put the results in the sales tax and total fields.

  • Defined an event handler function that will be connected to the clear button. In this function I should clear out all the fields and then put the cursor back in the subtotal field so it is ready for new input.

  • Defined an event handler function that will be used to initialize or setup the app. This event handler only needs code to bind the other two event listeners to the buttons. In this function add event listeners, for click events, to the two buttons and call the correct event handler function for each.

  • Added an event listener to the window object to listen for the load event and call the initialize/setup event handler function. This way when the page loads that will trigger JavaScript to setup the other two buttons click handlers.

  • Added basic validation to the input from the subtotal and tax rate field. It dispayed any errors with validation in an alert box which makes sure the the message in the alert box is clear and tells the user what is wrong with their input.

  • Basic validation which I generated The subtotal value needs to be a valid positive number [x > 0]. The tax rate value must be a number greater than 0 and less than or equal to 20 [0 < x <= 20].

salestaxcalculator's People

Contributors

shivaniagrawal14 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.