I cant get these bullet points to output in my new window th
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 onclick=\"bulletPoints()\">bullet points</button></td>
</tr>
Solution
The solution for the above problem goes like:
<tr>
<td> Entities</td>
<td> Outputs bullet point text</td>
<td> <button onclick=\"bulletPoints()\">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>
