-
Notifications
You must be signed in to change notification settings - Fork 103
6212 СтицюкКЮ Лаб. 4 #420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
6212 СтицюкКЮ Лаб. 4 #420
Conversation
lab4/calculator.html
Outdated
| <main class="calculator-main"> | ||
| <div class="calculator-card"> | ||
| <div class="input-group"> | ||
| <div class="input-wrapper"> | ||
| <label for="num1"><i class="fas fa-hashtag"></i> Первое число</label> | ||
| <input type="number" id="num1" placeholder="Введите число" step="any"> | ||
| </div> | ||
|
|
||
| <div class="operation-wrapper"> | ||
| <label for="operation"><i class="fas fa-cogs"></i> Операция</label> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
На примере этого блока про БЭМ
calculator-main
|
|__ calculator-main__calculator-card
|
|__ calculator-card__input-group
|
|__ input-group__input-wrapper
|
|__ input-group__operation-wrapper
|
|__ input-group__input-wrapper
lab4/calculator.js
Outdated
| const num1Input = document.getElementById('num1'); | ||
| const num2Input = document.getElementById('num2'); | ||
| const operationSelect = document.getElementById('operation'); | ||
| const calculateBtn = document.getElementById('calculate'); | ||
| const resetBtn = document.getElementById('reset'); | ||
| const resultDisplay = document.getElementById('result'); | ||
| const historyList = document.getElementById('history'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А если какой-то элемент не был найден?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не совсем понял вопрос. Можете, пожалуйста, поподробнее раскрыть?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Если getElementById вернет null, то дальше при попытке обратиться к его полям приложение упадет
|
Ладно принято, но такая сложная проверка элементов излишняя в данной лабе |
Добавил файлы 4й лабораторной работы.