Обновить js/DOM/Функции.md
This commit is contained in:
@@ -1,8 +1,15 @@
|
||||
|
||||
- Получить элемент. Его нет, возвращаем null
|
||||
|
||||
```js
|
||||
function getEl(el){
|
||||
return document.querySelector(el) ?? null;
|
||||
}
|
||||
```
|
||||
|
||||
- Загрузка скрипта после полной загрузки документа
|
||||
|
||||
```js
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
|
||||
})
|
||||
```
|
||||
Reference in New Issue
Block a user