reordered js

This commit is contained in:
Armen Vartan
2014-12-01 15:22:51 -05:00
parent 363ef9b198
commit cedce54eef
47 changed files with 0 additions and 0 deletions

View File

@ -0,0 +1,14 @@
### Intro to jQuery
In this assignment, you will be dynamically adding list elements with the comments from the form.
The flow is something like this - the user writes in the form and presses the submit button. That text is added to the page, under the form. The page is not refreshed, and the user can continue to add items.
Research the following to accomplish this challenge.
jQuery .append
Form inputs and how to access their values
jQuery .on (in this assignment, you will be using .on('submit'))
preventDefault

View File

@ -0,0 +1,5 @@
(function($, window, document) {
$(function(){
//your code here
});
}(window.jQuery, window, document));

View File

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="main.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" src="application.js"></script>
</head>
<body>
<form id="post-comment" action="#" method="post">
<input type="text" name="comment" placeholder="Type your comment.">
<input type="submit" value="Submit">
</form>
<ul id="comments"></ul>
</body>
</html>

View File

@ -0,0 +1,19 @@
body {
margin: 0 auto;
font-size: 20px;
}
#post-comment {
margin-top: 20px;
text-align: center;
}
li {
list-style: none;
height: 30px;
width: 100%;
padding: 1em;
}
li:nth-child(odd) {
background-color: lightgrey;
}