Skip to content

Лаб. 1 6411 Фурсова Мария#143

Open
FursovaMashaa wants to merge 4 commits intoitsecd:mainfrom
FursovaMashaa:main
Open

Лаб. 1 6411 Фурсова Мария#143
FursovaMashaa wants to merge 4 commits intoitsecd:mainfrom
FursovaMashaa:main

Conversation

@FursovaMashaa
Copy link
Copy Markdown

Одностраничное браузерное приложение "Калькулятор", реализованное на HTML, CSS и JavaScript. Приложение выполняет базовые арифметические операции с валидацией пользовательского ввода и обработкой ошибок.
Пользователь имеет возможность ввести два числовых значения, выбрать необходимую операцию сложения, вычитания, умножения или деления и получить результат мгновенно после нажатия кнопки подсчета.

@AvtoBBus AvtoBBus self-requested a review March 7, 2026 15:36
Comment on lines +3 to +8
const num1Input = document.getElementById('num1');
const num2Input = document.getElementById('num2');
const operationSelect = document.getElementById('operation');
const calculateBtn = document.getElementById('calculateBtn');
const resultDiv = document.getElementById('result');
const errorDiv = document.getElementById('error');
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Какой-то элемент может быть не найден

Comment on lines +44 to +47
if (n2 === 0) {
errorDiv.textContent = 'Ошибка: На ноль делить нельзя!';
hasError = true;
} else {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Есть момент, что у вас стоит у блока для ошибок стоит display: none и вы его не переставляете

index.html Outdated
<div class="calculator">

<div class="input-group">
<input type="text" id="num1" placeholder="Число 1">
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type="number" вам же не нужно вводить строки

@FursovaMashaa FursovaMashaa requested a review from AvtoBBus April 11, 2026 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants