-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9354019
commit 778ba91
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
if($.isReady) { | ||
console.log(".isReady says the DOM is ready! To party!") | ||
} else { | ||
console.log('.isNotReady :(')} | ||
document.addEventListener('DOMContentLoaded', function() { | ||
console.log("Let's get ready to party with vanilla JS!") | ||
}) | ||
$(console.log("The DOM is ready. Let's get ready to party with jQuery!")) | ||
|
||
$('article').attr('class', 'image-center'); | ||
// $('article').addClass('image-center'); | ||
|
||
$('p').eq('5').remove(); | ||
// $('article p:lastChild').remove(); | ||
|
||
$('#title').css('font-size', Math.random()*100); | ||
|
||
$('ol').append('<li>Whatever you want</li>'); | ||
|
||
$('aside').html("").append('<p>This is a long and lengthy and wordy and, perhaps even, verbose paragraph prepared as an apology for the former, and now removed, list of thoughts, which once resided in this position.</p>'); | ||
|
||
$('input.form-control').on("change click keyup", function() { | ||
let $red = $('input.form-control').eq(0).val(); | ||
let $green = $('input.form-control').eq(1).val(); | ||
let $blue = $('input.form-control').eq(2).val(); | ||
|
||
$('body').css('background-color', `rgb(${$red}, ${$green}, ${$blue})`) | ||
}) | ||
|
||
$('img').on('click', function(){ | ||
$(this).remove() | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
$('#subBttn').on('click', function() { | ||
let title = $('#titleInput').val(); | ||
let rating = $('#ratingInput').val(); | ||
|
||
if(title.length < 2 || !(0 <= rating && rating <= 10 )){ | ||
alert('Title must be at least two characters in length and rating must be between 0-10') | ||
} | ||
else { | ||
let $movie = $(`<li>Title: ${title} <br> Rating: ${rating}</li>`) | ||
let $delBttn = $(`<br><button id="delBttn">Delete</button>`) | ||
|
||
$($movie).append($delBttn); | ||
$('#movieList').append($movie); | ||
} | ||
$('#movieList').on('click', '#delBttn', function() { | ||
console.log(this) | ||
$(this).parent().remove(); | ||
}) | ||
}) | ||
|
||
|
||
|