|
17 | 17 | <header></header>, <p></p> etc - it is tags, each element on the page has opening |
18 | 18 | and closing tag (NOTE: some tags are self-closing like <img>). Whole html file is wrapped |
19 | 19 | in tag <html>, which contains of <head> and <body> tags. In <head> we keep different |
20 | | - meta information, title and link to css files. <Body> contains our actual content. |
| 20 | + meta information, title and link to css files. <body> contains our actual content. |
21 | 21 | Tags has a set of names which you can find here http://htmldog.com/references/html/tags/ |
22 | 22 |
|
23 | 23 | Any tag also can have different attributes (<div class="settings"></div> - tag div |
|
86 | 86 |
|
87 | 87 |
|
88 | 88 |
|
89 | | -//TODO: do you still remember arrays that we had in previous sections? Using this knowladge |
90 | | -//itirate through whole meadiaLinks items and print them out. |
| 89 | +//TODO: do you still remember arrays that we had in previous sections? Using this knowledge |
| 90 | +//iterate through whole meadiaLinks items and print them out. |
91 | 91 |
|
92 | 92 |
|
93 | 93 |
|
|
119 | 119 |
|
120 | 120 | /* |
121 | 121 | Change content |
122 | | - Using same property .innerHTML we can change content of the tags. |
| 122 | + we can change the content of the tags using the same .innerHTML property |
123 | 123 | Example: |
124 | 124 | ourTwitter.innerHTML = '@ButenkoMe'; |
125 | 125 | console.log(ourTwitter.innerHTML); |
126 | 126 | //guess what we will see on the page and in console? |
127 | 127 | */ |
128 | 128 |
|
129 | 129 |
|
130 | | -//TODO: change content of the 'h1' on anything you like |
| 130 | +//TODO: change content of the 'h1' with anything you like |
131 | 131 |
|
132 | 132 |
|
133 | 133 |
|
|
142 | 142 | */ |
143 | 143 |
|
144 | 144 |
|
145 | | -//TODO: replace 'src' attribute for our img tag on "img/kittens.jpeg" |
| 145 | +//TODO: replace the value of 'src' attribute for our img tag with "img/kittens.jpeg" |
146 | 146 |
|
147 | 147 |
|
148 | 148 |
|
149 | 149 |
|
150 | 150 |
|
151 | 151 | /* |
152 | 152 | Accessing and changing styles |
153 | | - So, let's do some css changes. We can do it with help of '.style' property and then |
154 | | - giving the css property as we use them in css file, the only change is - if is css |
| 153 | + So, let's do some css changes. We can do it with help of '.style' property and |
| 154 | + giving the css property just like we do in css file, the only change here is is - if is css |
155 | 155 | property name has '-' in the name (like font-size etc) then dash will be deleted and |
156 | | - next word starts with capital (fontSize) - this way of naming calls CamelCase :) |
| 156 | + next word starts with capital (fontSize) - this way of naming is called the CamelCase :) |
157 | 157 | Example: |
158 | 158 | var ourTwitter = document.querySelector('.twitter'); |
159 | 159 | ourTwitter.style.backgroundColor = 'white'; |
|
171 | 171 | /* |
172 | 172 | Creating new nodes (elements) |
173 | 173 | The document object also provides ways to create nodes from scratch: |
174 | | - document.createElement(tagName); |
175 | | - document.createTextNode(text); |
176 | | - document.appendChild(); |
| 174 | + document.createElement(tagName); --> create the element |
| 175 | + document.createTextNode(text); --> what text it should contain |
| 176 | + document.appendChild(); --> append it to the document |
177 | 177 | Example: |
178 | 178 | var pageNode = document.querySelector('body')[0]; |
179 | 179 | var newParagraph = document.createElement('p'); |
|
0 commit comments