Question: I keep getting an error on my homepage, but when i load it, under MY FAVORITE BAND when i click add nirvana it is supposed
I keep getting an error on my homepage, but when i load it, under "MY FAVORITE BAND" when i click "add nirvana" it is supposed to display "only talented bands?" but then it is saying in the console message that there is an error on my JS CODE however I do not know how to fix this error.
so this is my HTML CODE'
Abiodun's Website
Skip to Main Content
Hello! Welcome to my Homepage
Home
About
News
Content
Welcome to my Homepage!
Add My Name
This is my first time creating a website and it has been fun so far. My name is Abiodun Ogunwomoju and I am a Computer Information Systems (CIS) major. You will find some interest things about me here. My goal this semester is to learn how to create an advanced website without needing to watch a tutorial video. Someday,I hope to learn how to program with Java, C++, Swift, Ruby, Python and C.
FEEL FREE TO EXPLORE AROUND!!
My Favorite Band
The Beatles
Imagine Dragons
Big Time Rush
One Direction
The Beatles
Add Nirvana?
Only talented bands?
Interesting Things About Me
I am 19 years old.
I am Freshman/Junior.
I came to University of Houston with my Associates Degree.
I am eager to learn different types of programming language.
My favorite TV show is Persons of Interest
Show Console Log
and this is my JS CODE
@import url('bootstrap.min.css');
@import url('https://fonts.googleapis.com/css?family=Dosis');
html, body{
background-color:rgb(147, 130, 43);
font-size: 18px;
height:100%;
margin:0;
padding:0;
}
body {
display:flex;
font-family: san-serif;
flex-direction: column;
color: Black;
}
p{
margin: 1em;
}
p.ridge {
border-style: ridge;
color:maroon;
background-color: black;
}
#skip {
display: none;
}
a {
text-decoration: none;
}
a:hover {
color: black;
}
header {
background: Black;
flex: none;
margin: 0;
padding: 0;
text-align: center;
}
h1 {
color: maroon;
font-family:sans-serif;
font-weight: bold;
}
h1 a:link,
h1 a:visited,
h1 a:hover,
h1 a:active {
color: Maroon;
font-weight: 100;
font-family: 'Bradley Hand', cursive;
}
h2 {
color: black;
font-family:cursive;
text-align: center;
text-decoration: none;
text-transform: uppercase;
}
h1,h2 {display: inline-block;}
nav {
font-family: Verdana, sans-serif;
}
nav ul {
list-style-type: square;
margin: 0;
padding: 0;
background:maroon;
}
nav li:first-child {
display: none;
text-align:right;
}
nav li:first-child:hover {
background-color:red;
}
nav li:not(:first-child)
{
display:none;
}
nav li:hover {
background-color: black;
}
nav li:hover a {
background-color: black;
}
nav a{
display:block;
text-decoration: none;
}
nav a:link,
nav a:visited,
nav a:hover,
nav a active {
text-decoration:none;
color: Black;
}
#main-content {
flex: 1;
}
section {
flex-direction:column;
display: flex;
}
section button {
background-color: black;
display:block;
max-width: 100%;
margin: auto;
}
article{
flex: 1;
float: left;
text-align: center;
padding: 1em;
}
article ol{ text-align: left;}
pre {
display: none;
flex: 1;
margin: 1em;
}
#talented {
display: none;
}
footer {
background-color: black;
bottom: 0;
color: white;
display: block;
width: 100%;
padding: 1em;
}
@media all and (min-width: 600px){
section{display: flex; flex-direction:row;}
}
@media all and (min-width:720px)
{
nav ul {padding:0 0 0 auto;}
nav li:first-child{display:none;}
nav li: not(:first-child) {display: inline-block: !important;}
nav a {display: block; padding: 1em;}
}
home / study / engineering / computer science / computer science questions and answers / i keep getting an error on my homepage, but when i load it, under "my favorite band" when i ...
Your question needs more information to be answered.
A Chegg Expert needs more info to provide you with the best answer. See comments below.
Question: I keep getting an error on my homepage, but when i load it, under "MY FAVORITE BAND" when i click...
Edit question
I keep getting an error on my homepage, but when i load it, under "MY FAVORITE BAND" when i click "add nirvana" it is supposed to display "only talented bands?" but then it is saying in the console message that there is an error on my JS CODE however I do not know how to fix this error.
so this is my HTML CODE'
Skip to Main Content
Hello! Welcome to my Homepage
- Home
- About
- News
- Content
Welcome to my Homepage!
This is my first time creating a website and it has been fun so far. My name is Abiodun Ogunwomoju and I am a Computer Information Systems (CIS) major. You will find some interest things about me here. My goal this semester is to learn how to create an advanced website without needing to watch a tutorial video. Someday,I hope to learn how to program with Java, C++, Swift, Ruby, Python and C.
FEEL FREE TO EXPLORE AROUND!!
My Favorite Band
- The Beatles
- Imagine Dragons
- Big Time Rush
- One Direction
- The Beatles
Interesting Things About Me
- I am 19 years old.
- I am Freshman/Junior.
- I came to University of Houston with my Associates Degree.
- I am eager to learn different types of programming language.
- My favorite TV show is Persons of Interest
and this is my JS CODE
@import url('bootstrap.min.css');
@import url('https://fonts.googleapis.com/css?family=Dosis');
html, body{
background-color:rgb(147, 130, 43);
font-size: 18px;
height:100%;
margin:0;
padding:0;
}
body {
display:flex;
font-family: san-serif;
flex-direction: column;
color: Black;
}
p{
margin: 1em;
}
p.ridge {
border-style: ridge;
color:maroon;
background-color: black;
}
#skip {
display: none;
}
a {
text-decoration: none;
}
a:hover {
color: black;
}
header {
background: Black;
flex: none;
margin: 0;
padding: 0;
text-align: center;
}
h1 {
color: maroon;
font-family:sans-serif;
font-weight: bold;
}
h1 a:link,
h1 a:visited,
h1 a:hover,
h1 a:active {
color: Maroon;
font-weight: 100;
font-family: 'Bradley Hand', cursive;
}
h2 {
color: black;
font-family:cursive;
text-align: center;
text-decoration: none;
text-transform: uppercase;
}
h1,h2 {display: inline-block;}
nav {
font-family: Verdana, sans-serif;
}
nav ul {
list-style-type: square;
margin: 0;
padding: 0;
background:maroon;
}
nav li:first-child {
display: none;
text-align:right;
}
nav li:first-child:hover {
background-color:red;
}
nav li:not(:first-child)
{
display:none;
}
nav li:hover {
background-color: black;
}
nav li:hover a {
background-color: black;
}
nav a{
display:block;
text-decoration: none;
}
nav a:link,
nav a:visited,
nav a:hover,
nav a active {
text-decoration:none;
color: Black;
}
#main-content {
flex: 1;
}
section {
flex-direction:column;
display: flex;
}
section button {
background-color: black;
display:block;
max-width: 100%;
margin: auto;
}
article{
flex: 1;
float: left;
text-align: center;
padding: 1em;
}
article ol{ text-align: left;}
pre {
display: none;
flex: 1;
margin: 1em;
}
#talented {
display: none;
}
footer {
background-color: black;
bottom: 0;
color: white;
display: block;
width: 100%;
padding: 1em;
}
@media all and (min-width: 600px){
section{display: flex; flex-direction:row;}
}
@media all and (min-width:720px)
{
nav ul {padding:0 0 0 auto;}
nav li:first-child{display:none;}
nav li: not(:first-child) {display: inline-block: !important;}
nav a {display: block; padding: 1em;}
}
JS CODE
var log = '
This is a message in the console log.
';function showCopy() {
var d = new Date();
var year = d.getFullYear();
var month = d.getMonth();
Months= ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
var footer = document.getElementsByTagName('footer')[0];
var p = document.createElement('p');
p.innerHTML = '© '+ (Months[month])+ ' '+year +' by Abiodun (Abby) Ogunwomoju. All Rights Reserved.';
footer.appendChild(p);
log += '
A paragraph has been added to the footer.
';}
window.onload = showCopy;
function toggleMenu() {
var items = document.getElementsByClassName ('menuItem');
var icon = document.getElementById ('menuIcon');
if (items[0].style.display == 'block') {
for (var i=0;i items[i].style.display = 'none'; } icon.classList.remove('glyphicon-remove'); icon.classList.add('glyphicon-menu-hamburger'); icon.setAttribute ('aria-label','View Navigation'); } else { for (var i=0;i items[i].style.display = 'block'; } icon.classList.remove('glyphicon-menu-hamburger'); icon.classList.add('glyphicon-remove'); icon.setAttribute('aria-label','Collapse Navigation'); } } function addNirvana() { var item = document.createElement('li'); var nirvana = document.getElementById('nirvana'); item.innerHTML = 'Nirvana'; document.getElementById('myList').appendChild(item); log += ' Nirvana added to the list! var firstArt = document.getElementsByTagName('article')[0]; firstArt.removeChild(nirvana); log += ' #nirvana has been removed from HTML.
var talented = document.getElementById('talented');
talented.style.display = 'block';
log += '
#talented is now visible.
';}
function talentedBands() {
var list = document.getElementById('myList');
var listItems = list.getElementsByTagName('li');
for (var i=0; i if (!listItems[i].classList.contains('listItem')) { listItems[i].style.display = 'none'; } } log += ' Boring bands removed!
var talented = document.getElementById('talented');
talented.style.display = 'none';
log += '
#talented is now hidden again.
';}
function greetUser() {
var currHead = document.getElementById('greet');
var name = prompt('What\'s your name?','Enter your name here.');
if ((name == null) || (name == 'Enter your name here.') || (name == '')) {
name = 'Unknown';
}
currHead.innerHTML = 'Greetings, '+ name +'!';
log += '
'+ name +' has been greeted.
';}
function showMssg() {
var message = document.getElementsByTagName('pre')[0];
var console = document.getElementById('console');
if (message.style.display == 'block') {
log += '
The log is now hidden.
';message.style.display = 'none';
console.innerHTML = 'Show Console Log';
} else {
log += '
The log is now visible.
';message.innerHTML = log;
message.style.display = 'block';
console.innerHTML = 'Hide Console Log';
}
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
