Open
Conversation
dineenlauren
commented
Feb 18, 2019
| <!--TEST CODE ---------------------------------------------------------> | ||
| <div> | ||
| <h4>Saved Items</h4> | ||
| <ul id="list" class="saved-list"></ul> |
Collaborator
Author
There was a problem hiding this comment.
This Unordered List is where the title of a saved poem goes once a user clicks "Add Poem." But It keeps moving the entire <h2> element from line 103 to this list.
dineenlauren
commented
Feb 18, 2019
| <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p> | ||
| <p><a class="btn btn-default" href="#" role="button">View details »</a></p> | ||
| <div> | ||
| <h2 id="poem">Heading</h2> |
Collaborator
Author
There was a problem hiding this comment.
id="poem" for this <h2> element
dineenlauren
commented
Feb 18, 2019
| let poem = document.getElementById("poem"); | ||
| let poemName = poem; | ||
|
|
||
| li.appendChild(poemName); |
Collaborator
Author
There was a problem hiding this comment.
I know that it has something to with my JS here. I don't want to appendChild but I'm not sure how to push a copy of the text to the "saved content" list
Change (poemName) to (poem)
dineenlauren
commented
Feb 18, 2019
| function addPoem() { | ||
| let ul = document.getElementById("list"); | ||
| let li = document.createElement("li"); | ||
| let poem = document.getElementById("poem"); |
Collaborator
Author
There was a problem hiding this comment.
Suggested change
| let poem = document.getElementById("poem"); | |
| let poem = document.getElementById("poem").cloneNode(true); |
dineenlauren
commented
Feb 18, 2019
| let ul = document.getElementById("list"); | ||
| let li = document.createElement("li"); | ||
| let poem = document.getElementById("poem"); | ||
| let poemName = poem; |
Collaborator
Author
There was a problem hiding this comment.
Don't need this line. Can delete.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #4
Issue:
Before Save Button:
After Save Button: