From f257ca63c8ba60f11c0f30574a4e889d83122cf9 Mon Sep 17 00:00:00 2001 From: Bryan Choe Date: Sat, 28 Oct 2017 15:00:36 -1000 Subject: [PATCH] updates readme --- README.md | 7 +++++-- js/app.js | 29 +++++++++++++++++++++++++++-- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c4bb539..2dcd2be 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,13 @@ 1. **Fork** this repository 2. **Clone** this repository from your personal Github account: - Copy the HTTPS or SSH address on the page. - - From you DevLeague folder, run the command `$ git clone [SSH or HTTP address]` in your terminal in order to clone this repository into that folder + - From you DevLeague folder, run the command `$ git clone [SSH or HTTP address]` in your terminal in order to clone this repository into that folder (you don't need to type the "$"; this is the command __prompt__, and is used to signify your terminal is ready for commands). 3. From your terminal, navigate into the js-DOM assignment: - `$ cd js-DOM` 4. Open the js-DOM assignment in sublime and write your code in the `app.js` file. 5. Run live-server to see your results in the browser - + +Optional + For macs - `cmd + opt + 2` to open 2 columns in your text editor + For win - `ctrl + shift + 2` to open 2 columns in your text editor diff --git a/js/app.js b/js/app.js index bffad5b..19d8b59 100644 --- a/js/app.js +++ b/js/app.js @@ -6,10 +6,12 @@ Find the div with the id of "name1" and replace the n/a with the following: Tay-Tay*/ +var taylorSwift = document.getElementById('name1'); +taylorSwift.innerHTML = 'Tay-Tay'; /*2. DJ Khaled -Find the div with the id of "position2" and replace the n/a with the following: +Find the div with the id of "position2" and replace the n/a with the following: Project Manager*/ @@ -27,6 +29,9 @@ Concatenation*/ Find the div with the class name of "profile" and replace the n/a with a verse from your favorite Prince song.*/ +var princeMe = document.getElementsByClassName('profile'); +console.log(princeMe); +princeMe[0].innerHTML = 'Diamonds and pearls' /*5. Bruce Lee @@ -47,8 +52,13 @@ Create a div element and give it an id of "name7". Inside this div element, give Append this div element to the nameParent div*/ +var familyGuy = document.createElement('div'); +familyGuy.id = 'name7'; +familyGuy.innerHTML = 'Peter Griffin'; +var parentDiv = document.getElementById('nameParent'); +parentDiv.appendChild(familyGuy); + - /*8. Tim Duncan Create a div element give it an id of "alias8". Inside this div element, give it the contents of "Old Man Riverwalk". @@ -60,3 +70,18 @@ Append this div element to the aliasParent div.*/ //Final Boss /*9. Create your own profile.*/ +/*var name = document.createElement('div'); +name.id = 'name9'; +name.innerHTML = 'Long Duck Dong'; +block3[2].appendChild(name);*/ +var startDiv = document.getElementsByClassName('block3 col-sm-4'); +console.log(startDiv); + +var myPic = document.getElementsByTagName('img'); +console.log(myPic); +myPic[8].src = "http://www.dailyactor.com/wp-content/uploads/2014/05/Long+Duk+Dong-Gedde+Watanabe-audition.jpg"; + +var nameDiv = document.createElement('div'); +nameDiv.innerHTML = 'Long Duk Dong'; +nameDiv.id = 'name9'; +startDiv[2].appendChild(nameDiv); \ No newline at end of file