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
21 changes: 16 additions & 5 deletions Challenges/Week2/app.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
//create function
//control and return statements

//Prompt user for input and store variable
function processInput(message)
{
if(message === "hello")
{
return ("Hello World!");
}
else {
return("You didn't say hello :(");
}
}

//Call function
var userInput;

//Alert user results
userInput = prompt();

var response = processInput(userInput);

console.log(response);
2 changes: 1 addition & 1 deletion Challenges/Week2/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ <h2>My first code challenge!</h2>
<li>Don't forget to call your script file from this HTML file! I've created the script tags for you, but you have to add something to it!
</ol>

<script></script>
<script src="app.js"></script>
</body>
</html>
3 changes: 1 addition & 2 deletions Challenges/Week3/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ <h1>Flash Cards</h1>
</ul>

<button class="cheat-button">Show All Answers</button>

<!--Replace this comment with a script tag from https://code.jquery.com/ -->
<script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha256-cCueBR6CsyA4/9szpPfrX3s49M9vUU5BgtiJj06wt/s=" crossorigin="anonymous"></script>
<script src="js/app.js" type="text/javascript" charset="utf-8"></script>
</body>
</html>
13 changes: 9 additions & 4 deletions Challenges/Week3/js/app.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
// 1.) Make sure you have a reference to jQuery from a CDN in the index.html file.

// 2.) Use a jQuery to hide all of the answers to all the questions.
$('.answer')
$('.answer').hide();

/* 3.) Write code to show the answer when hovering over a flash card, and hide it when the mouse leaves.
Find the approriate event on the jQuery API page to trigger an action on hover https://api.jquery.com/category/events/
Hint: You can use "this" inside your jQuery function to reference a selected DOM node. */
$('.flash-card')

$('.flash-card').hover(function () {
$(this).find('.answer').show();
}, function () {
$(this).find('.answer').hide();
});
/* 4.) Use jQuery to find the button element on the page and have it toggle all of the answers on and off when clicked.
Hint: jQuery has a toggle function that can toggle the visibility of a selected DOM node.
Bonus: Change the text of the button using jQuery when you toggle the answers on/off. */
$()
$('.cheat-button').click(function () {
$('.answer').toggle();
})
1 change: 1 addition & 0 deletions test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hello world