Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
assignment_js_sprint
====================
assignment_jq_dom_sprint
========================

while(1){ go() };
...that DOM, D-DOM DOM DOOOOM...
35 changes: 35 additions & 0 deletions document.ready.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
$(document).ready(function(){

//Set H1 text to "Something Cheeky"
$('h1').text("Something Cheeky");

//Insert an HTML element to our div element with the class info-box
$('div.info-box').append("<ol><li>one</li><li>two</li><li>three</li></ol>");

//Change the class of "sad" elements to "happy"
$('.sad').addClass("happy");
$('.happy').removeClass("sad");

//Change the attribute of the pop up's href link to a different url
$('#annoying-popup a').attr('href', 'http://www.cashcats.biz');

//Change the position of the pop-up with CSS styling
$('#annoying-popup').css({
'right': '0px',
'top': '30px'
});

//Set our $list variable as our list we want so we can refer to it's cells
var $list = $('.suggested-topics ul').children();
//check each cell's inner HTML and then change it if it is "..."
for ( i = 0; i < $list.length; i++ ) {
if( $list[i].innerHTML == "..." ) {
$list[i].innerHTML = "sample text";
}}

//Add in a textarea and remove the text input
$('.input-form input[type="text"]').remove();
$('.input-form').html("<textarea></textarea>" + $('.input-form').html());


});
117 changes: 51 additions & 66 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,75 +1,60 @@
<!doctype html>
<html>
<head>
<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="scripts.js"></script>
<script src="scripts_spec.js"></script>
<style>
h1,h2,h3,p{
text-align: center;
}
.output{
padding: 20px;
width: 300px;
margin: 20px auto;
border: 1px solid black;
}
</style>
</head>
<body>
<h1>
Javascript Sprint Test Suite
<head>
<script type="text/javascript" src="jquery-3.2.1.js"></script>
<link rel="stylesheet" type="text/css" href="styles.css">
<script type="text/javascript" src="scripts.js"></script>
<script type="text/javascript" src="document.ready.js"></script>
</head>
<body>
<header>
<h1>
Traverse and Manipulate
</h1>
<p>
<em>Admirable objectives for a jQuery Padwan</em>
</p>
</header>

<h3>
Largest Element:
</h3>
<div class="output" id="largest-el">
Pending...
</div>
<div class="info-box sad">
<h4>
Upcoming traversals:
</h4>
</div>

<h3>
Reversed String:
</h3>
<div class="output" id="reversed">
Pending...
<main>
<h2>
Input your Story
</h2>
<div class="input-form">
<form action="/uh-oh">
<input type="text" placeholder="Tell me a story!">
<input type="submit" value="Submit!">
</form>
</div>

<h3>
Loud Snake Case:
</h3>
<div class="output" id="loud-snake-case">
Pending...
<div class="suggested-topics">
<h3>
Suggested Topics
</h3>
<ul>
<li>Funny functions</li>
<li>Terrible traversals</li>
<li class="sad">Cogent collisions</li>
<li class="super-duper sad">Super selections</li>
<li>Massive manipulations</li>
<li>Admirable alterations</li>
<li>...</li>
<li>Killer klicks</li>
</ul>
</div>
</main>

<h3>
Compare Arrays:
</h3>
<p>
<em>Note: The rest of the test suite depends on getting this right!</em>
</p>
<div class="output" id="compare-arrays">
Pending...
</div>
<div id="annoying-popup" class="blink">
<a href="http://www.evilwebsite.com">
Click me to get free stuff!!!!
</a>
</div>

<h3>
Fizz Buzz:
</h3>
<div class="output" id="fizz-buzz">
Pending...
</div>
</body>

<h3>
My Map:
</h3>
<div class="output" id="my-map">
Pending...
</div>

<h3>
Primes:
</h3>
<div class="output" id="primes">
Pending...
</div>
</body>
</html>
</html>
4 changes: 4 additions & 0 deletions jquery-3.2.1.js

Large diffs are not rendered by default.

Loading