/    Sign up×
Community /Pin to ProfileBookmark

Simple Exercise in JS

How can I create a html and js code with these conditions:

3 different modes will be used to add the input number to the div

  • 1. When you press “Enter” in the input or when you click the “Add” button with the left mouse button, a paragraph with text-align “left” should be added

  • 2. When we press “Shift” in the input or when we click the “Add” button with the middle mouse button, a paragraph with text-align “center” will be added to the div

  • 3. When we press “Alt” in the input or when we click the “Add” button with the right mouse button, a text-align “right” paragraph will be added to the div
  • • When you click on each paragraph within the div, the paragraph will get a background-color and will increase font-size.
    • Whenever we press “SHIFT – A” the sum of all numbers will be calculated and displayed at the bottom of the page.
    • After adding each number the data will be stored in localstorage and when the page opens this data will reappear on the page

    to post a comment
    JavaScript

    1 Comments(s)

    Copy linkTweet thisAlerts:
    @florian788authorDec 24.2019 — @florian788#1612147 Anyone ?
    ×

    Success!

    Help @florian788 spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 4.30,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,

    tipper: @Samric24,
    tipped: article
    amount: 1000 SATS,
    )...