I can\'t get these bullet points to output in my new window that I\'m creating w
ID: 3936802 • Letter: I
Question
I can't get these bullet points to output in my new window that I'm creating when I call the function.
Now when I click on bullet points, the information displays in the current window, I need it to display in a new window. Here is the javascript:
function bulletPoints(){ //outputting okay, just not in new webpage
page += document.write("<ul><li>Unordered list item 1</li><li>Unordered list item 2</li><li>Unordered list item 3</li></ul>");
}
and here is the html:
<tr>
<td> Entities</td>
<td> Outputs bullet point text</td>
<td> <button>bullet points</button></td>
</tr>
Explanation / Answer
The solution for the above problem goes like:
<tr>
<td> Entities</td>
<td> Outputs bullet point text</td>
<td> <button>bullet points</button></td>
</tr>
//and in script tag we write:
<script>
function bulletPoints(){
var newWindow=window.open(); //this create a new window and then adds the html there.
newWindow.document.write("<ul><li>Unordered list item 1</li><li>Unordered list item 2</li><li>Unordered list item 3</li></ul>");
}
</script>
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.