Compare commits
2 Commits
df28627c68
...
75e3463ec7
Author | SHA1 | Date | |
---|---|---|---|
75e3463ec7 | |||
1c051fe813 |
|
@ -1,4 +1,5 @@
|
|||
# HTML
|
||||
|
||||
- [favicons.html](favicons.html)
|
||||
- [anchors.html](anchors.html) - Пример использования якоря на странице
|
||||
- [humans.txt](humans.txt)
|
||||
|
|
3
HTML/anchors.html
Normal file
3
HTML/anchors.html
Normal file
|
@ -0,0 +1,3 @@
|
|||
<p><a name="top"></a></p>
|
||||
<p>...</p>
|
||||
<p><a href="#top">Наверх</a></p>
|
|
@ -5,6 +5,9 @@
|
|||
- [Spread syntax](spread.js) - распаковка массива в аргументы
|
||||
- [fetch](fetch.js) - ...
|
||||
- [location.href](location.href.js) - Переход на другую страницу
|
||||
- [Text Content](textContent.js) - Получить текстовое содержимое элемента
|
||||
- [Add DOM Elements](addElements.js) - Добавление элементов в DOM
|
||||
- [Add Class](addClass.js) - Добавление/Удаление классов
|
||||
|
||||
## Other
|
||||
- [Webpack](webpack.md) example config
|
||||
|
|
5
JavaScript/addClass.js
Normal file
5
JavaScript/addClass.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
// Use element.classList.add to add a class:
|
||||
element.classList.add('my-class');
|
||||
|
||||
// And element.classList.remove to remove a class:
|
||||
element.classList.remove('my-class');
|
3
JavaScript/addElements.js
Normal file
3
JavaScript/addElements.js
Normal file
|
@ -0,0 +1,3 @@
|
|||
let newDiv = document.createElement('div');
|
||||
newDiv.appendChild(document.createTextNode('some text'));
|
||||
document.body.appendChild(newDiv);
|
3
JavaScript/textContent.js
Normal file
3
JavaScript/textContent.js
Normal file
|
@ -0,0 +1,3 @@
|
|||
document.getElementById('element').textContent;
|
||||
// If you need to target < IE9 then you need to use
|
||||
document.getElementById('element').innerText;
|
Loading…
Reference in New Issue
Block a user