GithubHelp home page GithubHelp logo

caward12 / javascript-add-comments-challenge Goto Github PK

View Code? Open in Web Editor NEW

This project forked from turingschool-examples/javascript-add-comments-challenge

0.0 1.0 0.0 3 KB

JavaScript 32.50% HTML 34.79% CSS 32.71%

javascript-add-comments-challenge's Introduction

JavaScript Add Comments Challenge

Overview

In this challenge, we're going to build on a common feature of the web: the comment area.

Normally, when you are building a comment form you want to send the data to the server so that the comment can be persisted in a database somewhere. Since we don't have access to a server in this case, we're just going to bypass that feature. Instead, we will build a form that uses JavaScript and jQuery to create a new DOM element from the form data and append it to a list of comments.

There are a few different moving parts to this challenge so make sure you're familiar with the following:

If you bind to the submit event, you should consider using the event.preventDefault() method provided by jQuery.

All of the HTML and CSS has been written in the source directory. You only need to add your own jQuery-flavored JavaScript.

It's suggested that you read the HTML (and CSS) closely so that you understand the structure of the page.

Add Comments using jQuery/JS

The desired behavior is shown in the following video: Add Comments

This behavior isn't too exciting, but this is a common pattern (adding new elements to the DOM via a form), and it is important to understand how to make it work with jQuery and JavaScript.

Here is a sequence of events and requirements for this feature:

  • When the user clicks on the New Comment button, the new comment form should appear.
  • When the user enters text into the two fields and presses the Create Comment button, a new comment should be created and added to the end of the comment list.
  • A new comment should not be empty, i.e. if the user submits the form without entering anything into the text area, an empty comment element should not be created. A user can submit the form without adding in the author's information though.

Make sure to follow the specifications, and remember to take it slow. Verify your assumptions before getting ahead of yourself.

Resources

javascript-add-comments-challenge's People

Contributors

case-eee avatar caward12 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.