Main.js


#1

hi, i need help doing main.js
this was the question
Inside index.html, notice there's an

element with a class of skillset on line 10. Let's select this element with JavaScript.

Click on the folder icon to navigate to js/main.js.

Inside main.js, delete the alert you wrote in the last exercise. Then, create a variable named skillset and set it equal to the HTML element with the class skillset.

and i answered back
var skillset = ('skill-html')


#2

In the lesson they explain
We can select an HTML element with JavaScript by selecting its class attribute, like this:

var header = document.getElementsByClassName('example-class-name');


#3

Taking a closer look at the course....
You will have to select the =folder-image= on the left-hand-side of the =index.html= tab.

files
css
js
test
index.html

=click= on the js-folder and you will see the main.js file.

files
css
js
       main.js   <<click on this file to get a =main.js= tab.
test
index.html

========================================================
After clicking on the now visible main.js tab
you will enter into this file
and will have to add the requested =Javascript= statements.

========================================================
BUT
before using the RUN button
you will have to -click on the index.html tab
and add a HTML line
<script type="text/javascript" src="js/main.js"></script>
into the <head></section>
So in the end your -head-section should look like

<head>
  <link rel='stylesheet' type='text/css' href='css/styles.css'>
  <script type="text/javascript" src="js/main.js"></script>
</head>

===============================================
Now =click= the RUN-button


#4

This topic was automatically closed after 7 days. New replies are no longer allowed.