Start with Python

This commit is contained in:
Kenneth Mendonca
2015-07-22 16:44:07 -04:00
parent 94031a251f
commit 57cb3981a0
100 changed files with 2085 additions and 0 deletions

View File

@ -0,0 +1,13 @@
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;
}