๐Ÿช„ ๊ฐ„๋‹จํ•œ ๊ธฐ๋Šฅ ๊ตฌํ˜„. Calculator

[meษช]ยท2022๋…„ 1์›” 6์ผ
0

5. Mini Toy Projects

๋ชฉ๋ก ๋ณด๊ธฐ
11/17
post-thumbnail

Make a Calculator in HTML, CSS and JavaScript

### ๋“œ๋””์–ด ๊ณ„์‚ฐ๊ธฐ๋‹ค์šด ๊ณ„์‚ฐ๊ธฐ ๋งŒ๋“ค๊ธฐ

#### innerText, innerHTML๋กœ ๊ฐ’ ํ™œ์šฉ
#### ๋‚ด๊ฐ€ ์ˆ˜์ •ํ•œ ๊ฒƒ
DEL์„ ๋ˆŒ๋ €์„ ๋•Œ out.innerHTML.length <= 1์ด๋ฉด out.innerHTML = "0"๊ฐ€ ๋˜๋„๋ก ์•Œ๋ ค์ฃผ์…จ์œผ๋‚˜
์ด๋ ‡๊ฒŒ ํ•˜๋ฉด ๋‘ ์ž๋ฆฌ ์ˆซ์ž์ผ ๋•Œ ๋ชจ๋“  ์ˆซ์ž๊ฐ€ ์‚ฌ๋ผ์ง€๊ณ  0์ด ๋‚จ๋Š”๋‹ค.
๊ทธ๋ž˜์„œ out.innerHTML.length <= 0์œผ๋กœ ๊ณ ์ณ์ฃผ์—ˆ๋‹ค.

#### ํ•œ๊ณ„
์—ฌ์ „ํžˆ eval ํ•จ์ˆ˜๋ฅผ ์ผ๋‹ค.

#### deprecated
event๋ผ๊ณ  ์“ฐ๋ฉด deprecated๋ผ๋ฉฐ ์ทจ์†Œ์„ ์ด ๊ทธ์–ด์ง€๊ณ  (์ฐ์ฐ...) e๋ผ๊ณ  ์“ฐ๋ฉด JS๊ฐ€ ๋™์ž‘ํ•˜์ง€ ์•Š๋Š”๋‹ค......

๐Ÿ™‡ the source of this content

doctor code

profile
๋Š๋ ค๋„ ํ•  ๊ฑฐ์•ผ.......

0๊ฐœ์˜ ๋Œ“๊ธ€