Coder Social home page Coder Social logo

jquery-assessment's Introduction

jQuery Assessment

For this assessment, you will be creating a simple application. When the page loads, it should have a button already on the DOM that reads "Click me". When that button is clicked, it should create a new div that contains some text, and two buttons. It should have a data attribute called 'data-button-toggle' and set that value equal to 1. In a CSS file, target a class that changes the background color of the div to green.

The Text in the new div should read "Here are the number of clicks: ", then have a number that represents how many times the "Click me" button has been clicked.

The first button in the div should have the text "Change color". When clicking on it, it should change the parent divs background color to red. This will require you looking up the .css() method in the jQuery documentation if you do not already know how to use it. Once you do that, target the data attribute you created in the div and set it equal to 2. Now, when you click this button again, check to see if the value is 2, if it is, set the data attribute equal to 1 and set the background color of the div back to green. Basically, the button should toggle the background color between green and red. This link will help you understand the .data() method of jquery better, thus helping you with the challenge: (https://api.jquery.com/data/)

The second button in the div should have the text "Remove". When clicking it, it should remove the parent div from the DOM using the .remove() method.

Do not worry about altering the button click count based on the amount of divs you remove. No other styling of 'extras' are needed for this challenge, in fact, please don't add any additional work. Once you are complete, check your work into a new repo on your GitHub account with the repo name of 'jquery_assessment'.

If there are any things in this assessment that you cannot complete, that is fine! Just complete what you can. This is all about knowing how to help you best.

You need not check this repo with this readme out and mess with git. Go ahead and just start a new repo, with new files and work out of that.

jquery-assessment's People

Contributors

katiebvogel avatar

Watchers

James Cloos avatar  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.