[JavaScript] input ํƒœ๊ทธ disabled ์†์„ฑ์„ ์ด์šฉํ•œ ๋ฒ„ํŠผ ํ™œ์„ฑํ™”/๋น„ํ™œ์„ฑํ™”
ยท
Frontend/JavaScript
๊ฒฝ๋งค ์„œ๋น„์Šค ํ”„๋กœ์ ํŠธ๋ฅผ ํ•˜๋‹ค๋ณด๋‹ˆ ์ƒํ™ฉ์— ๋”ฐ๋ฅธ ๋ฒ„ํŠผ ๋น„ํ™œ์„ฑํ™”๊ฐ€ ํ•„์š”ํ•˜์˜€๊ณ , ์ด๋ฅผ ์œ„ํ•ด ๊ธฐ๋ณธ์ ์ธ ๋ฒ„ํŠผ ๋น„ํ™œ์„ฑํ™” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด ์•Œ์•„๋ณด์•˜๋‹ค. input ํƒœ๊ทธ ๋‚ด์— disabled ์†์„ฑ ์‚ฌ์šฉSee the Pen button disabled by SeongHo-C (@seongho-c) on CodePen. input ํƒœ๊ทธ์— disabled ์†์„ฑ์„ ๋”ฐ๋กœ ๋ช…์‹œํ•˜์ง€ ์•Š์œผ๋ฉด, ๋ฒ„ํŠผ์€ ๊ธฐ๋ณธ์ ์œผ๋กœ ํ™œ์„ฑํ™” ์ƒํƒœ๊ฐ€ ๋œ๋‹ค.input ํƒœ๊ทธ์— disabled ์†์„ฑ์„ ๋ช…์‹œํ•ด ์ฃผ๋ฉด, ๋ฒ„ํŠผ์€ ๋น„ํ™œ์„ฑํ™” ์ƒํƒœ๊ฐ€ ๋œ๋‹ค. ํ™œ์„ฑํ™”/๋น„ํ™œ์„ฑํ™” ๋ฒ„ํŠผ์„ ํด๋ฆญํ•˜์—ฌ ๋ฒ„ํŠผ์˜ ์ƒํƒœ ๋ณ€๊ฒฝSee the Pen button click disabled by SeongHo-C (@seongho-c) on CodePen. [JAVASCRIPT]const target =..
[JavaScript] ํ˜„์žฌ ์‹œ๊ฐ„๊ณผ ๋น„๊ตํ•ด ๋‚จ์€ ์‹œ๊ฐ„ ๊ตฌํ•˜๊ธฐ(์ผ, ์‹œ, ๋ถ„, ์ดˆ)
ยท
Frontend/JavaScript
ํ˜„์žฌ ์‹œ๊ฐ„๊ณผ ๋งˆ๊ฐ ๊ธฐ๊ฐ„์„ ๋น„๊ตํ•ด ๋‚จ์€ ์‹œ๊ฐ„ ๊ตฌํ•˜๊ธฐfunction remaindTime(endDate) { // ํ˜„์žฌ ์‹œ๊ฐ„์„ ๊ตฌํ•œ๋‹ค. const now = new Date(); // ๋งˆ๊ฐ ๊ธฐ๊ฐ„์„ ๊ฐ€์ ธ์˜จ๋‹ค. const end = new Date(endDate); // ํ˜„์žฌ ์‹œ๊ฐ„์„ ms๋กœ ๋ฐ˜ํ™˜ํ•œ๋‹ค. const nt = now.getTime(); // ๋งˆ๊ฐ ๊ธฐ๊ฐ„์„ ms๋กœ ๋ฐ˜ํ™˜ํ•œ๋‹ค. const et = end.getTime(); // ๋งˆ๊ฐ ๊ธฐ๊ฐ„์ด ํ˜„์žฌ ์‹œ๊ฐ„๋ณด๋‹ค ํด ๊ฒฝ์šฐ if (nt  ์ถœ๋ ฅ ๊ฒฐ๊ณผํ˜„์žฌ ์‹œ๊ฐ„: Tue Jul 23 2024 16:09:33 GMT+0900 (Korean Standard Time) ๋‚จ์€ ์‹œ๊ฐ„: 365์ผ 00์‹œ๊ฐ„ 00๋ถ„ 26์ดˆ
[JAVASCRIPT] Fetch API & FormData๋ฅผ ์ด์šฉํ•œ ๋‹ค์ค‘ํŒŒ์ผ ์—…๋กœ๋“œ
ยท
Frontend/JavaScript
โ— ์ƒํ’ˆ ์ด๋ฏธ์ง€ ์—…๋กœ๋“œ๋ฅผ ์œ„ํ•œ HTML ์ƒํ’ˆ ์ด๋ฏธ์ง€ ๋“ฑ๋ก ํƒœ๊ทธ์˜ enctype ์†์„ฑ๊ฐ’์€ multipart/form-data๋กœ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค. โ€ป๋งค์šฐ ์ค‘์š”โ€ป ํƒœ๊ทธ์˜ multiple ์†์„ฑ์€ ์š”์†Œ์— ์‚ฌ์šฉ์ž๊ฐ€ ๋‘˜ ์ด์ƒ์˜ ๊ฐ’์„ ์ž…๋ ฅํ•  ์ˆ˜ ์žˆ์Œ์„ ๋ช…์‹œํ•ฉ๋‹ˆ๋‹ค. ํŒŒ์ผ์„ ์—…๋กœ๋“œ ํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š” ํƒœ๊ทธ์˜ type ์†์„ฑ๊ฐ’์€ file๋กœ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค. โ— ์ด๋ฒคํŠธ๋ฆฌ์Šค๋„ˆ ์ด์šฉ์„ ์œ„ํ•œ ํƒœ๊ทธ ๋“ฑ๋ก โ— Fetch API & FormData๋ฅผ ์ด์šฉํ•˜์—ฌ ์„œ๋ฒ„์— Request ์ „๋‹ฌ fetch() ํ•จ์ˆ˜๋Š” ์ฒซ๋ฒˆ์งธ ์ธ์ž๋กœ URL, ๋‘๋ฒˆ์งธ ์ธ์ž๋กœ Option ๊ฐ์ฒด๋ฅผ ๋ฐ›๊ณ , Promise ํƒ€์ž…์˜ ๊ฐ์ฒด๋ฅผ ๋ฆฌํ„ดํ•ฉ๋‹ˆ๋‹ค. URL์€ ํ•„์ˆ˜ ๋งค๊ฐœ๋ณ€์ˆ˜ ์ž…๋‹ˆ๋‹ค. ๋ฐ˜ํ™˜๋œ ๊ฐ์ฒด๋Š”, API ํ˜ธ์ถœ์ด ์„ฑ๊ณตํ–ˆ์„ ๊ฒฝ์šฐ response ๊ฐ์ฒด๋ฅผ resolveํ•˜๊ณ , ์‹คํŒจํ–ˆ์„ ๊ฒฝ์šฐ error ..
[HTML] ๋“œ๋กญ๋‹ค์šด ๋ชฉ๋ก
ยท
Frontend/HTML
์œ„ ๊ทธ๋ฆผ๊ณผ ๊ฐ™์ด ์ž…์ฐฐ ๋‹จ์œ„ ๋‚ด์šฉ์— ๋“œ๋กญ๋‹ค์šด ๋ชฉ๋ก์„ ์‚ฌ์šฉํ•ด ๋ณด์•˜์Šต๋‹ˆ๋‹ค. ๋“œ๋กญ๋‹ค์šด ๋ชฉ๋ก์€ ์‚ฌ์šฉ์ž๊ฐ€ ๋‚ด์šฉ์„ ์ง์ ‘ ์ž…๋ ฅํ•˜์ง€ ์•Š๊ณ  ์—ฌ๋Ÿฌ ์˜ต์…˜ ์ค‘์—์„œ ์„ ํƒํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•ด์ค๋‹ˆ๋‹ค. ์„ ํƒํ•˜์„ธ์š” 1,000 ์› 3,000 ์› 5,000 ์› 1,0000 ์› ํƒœ๊ทธ๋กœ ๋“œ๋กญ๋‹ค์šด ๋ชฉ๋ก์˜ ์‹œ์ž‘๊ณผ ๋์„ ํ‘œ์‹œํ•˜๊ณ , ๊ทธ ์•ˆ์— ํƒœ๊ทธ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์›ํ•˜๋Š” ํ•ญ๋ชฉ์„ ์ถ”๊ฐ€ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. โ— ํƒœ๊ทธ์˜ ์†์„ฑ size: ํ™”๋ฉด์— ํ‘œ์‹œํ•  ๋“œ๋กญ๋‹ค์šด ํ•ญ๋ชฉ์˜ ๊ฐœ์ˆ˜๋ฅผ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค. (default = 1) multiple: ๋“œ๋กญ๋‹ค์šด ๋ชฉ๋ก์—์„œ ๋‘˜ ์ด์ƒ์˜ ํ•ญ๋ชฉ์„ ์„ ํƒํ•  ๋•Œ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. โ— ํƒœ๊ทธ์˜ ์†์„ฑ value: ํ•ด๋‹น ํ•ญ๋ชฉ์„ ์„ ํƒํ•  ๋•Œ ์„œ๋ฒ„๋กœ ๋„˜๊ฒจ์ค„ ๊ฐ’์„ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค. selected: ๋“œ๋กญ๋‹ค์šด ๋ฉ”๋‰ด๋ฅผ ์‚ฝ์ž…ํ•  ๋•Œ ๊ธฐ๋ณธ์ ์œผ๋กœ ์„ ํƒํ•ด์„œ ๋ณด์—ฌ ์ค„ ํ•ญ๋ชฉ์„ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค.
[CSS] Bootstrap ํƒญ ์‚ฌ์šฉ๋ฒ•
ยท
Frontend/CSS
์›น ๊ฐœ๋ฐœ์„ ํ•˜๋ฉด์„œ ํƒญ์€ ๋งค์šฐ ์œ ์šฉํ•˜๊ฒŒ ์‚ฌ์šฉ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์œ„ ์‚ฌ์ง„์€ ์ œ๊ฐ€ ์ง์ ‘ Bootstrap์„ ์‚ฌ์šฉํ•˜์—ฌ ๋งŒ๋“  ํƒญ ์ž…๋‹ˆ๋‹ค. ์ฐจ๋ก€๋Œ€๋กœ ํƒญ ์‚ฌ์šฉ๋ฒ•์— ๋Œ€ํ•ด ์•Œ๋ ค๋“œ๋ฆฌ๊ฒ ์Šต๋‹ˆ๋‹ค. โ— ์™ธ๋ถ€ ์Šคํƒ€์ผ์‹œํŠธ ์ ์šฉ ๊ธฐ๋ณธ์ ์œผ๋กœ ํƒœ๊ทธ ์•ˆ์— ๋„ฃ์–ด ์ฃผ์…”์•ผ ํ•ฉ๋‹ˆ๋‹ค. โ— ํƒญ ๋ฉ”๋‰ด ๊ตฌ์„ฑ ํŒ๋งคํ˜„ํ™ฉ ๊ตฌ๋งคํ˜„ํ™ฉ , ํƒœ๊ทธ๋ฅผ ์ด์šฉํ•˜์—ฌ ์ˆœ์„œ ์—†๋Š” ๋ชฉ๋ก์„ ๋งŒ๋“ค๊ณ  ๋ฒ„ํŠผ์œผ๋กœ ํƒญ ๋ฉ”๋‰ด๋ฅผ ๋งŒ๋“ค์—ˆ์Šต๋‹ˆ๋‹ค. โ— ๋ฉ”๋‰ด๋ณ„ ๋‚ด์šฉ ๊ตฌ์„ฑ ์ƒํ’ˆ๋ช… ์ตœ๊ณ ์ž…์ฐฐ๊ฐ€ ๊ฒฝ๋งค์ƒํƒœ ๋‚จ์€ ๋งˆ๊ฐ์‹œ๊ฐ„ HTML CSS JAVASCRIPT ... ํƒœ๊ทธ๋ฅผ ์ด์šฉํ•˜์—ฌ ๋ฉ”๋‰ด๋ณ„ ๋‚ด์šฉ์„ ๊ตฌ์„ฑํ•˜์˜€์Šต๋‹ˆ๋‹ค. ํƒœ๊ทธ๋ฅผ ์ด์šฉํ•˜์—ฌ ๊ฐ ์—ด๋งˆ๋‹ค ๋„ˆ๋น„๋ฅผ ์ง€์ •ํ•˜์˜€์Šต๋‹ˆ๋‹ค. โ— ํƒญ ์ „ํ™˜ JS ์ ์šฉ โ— Bootstrap JavaScript plugin ์ ์šฉ ๋ฅผ ํƒœ๊ทธ๊ฐ€ ๋‹ซํžˆ๊ธฐ ์ „์— ํŽ˜์ด์ง€ ๋ ๋ถ€๋ถ„์— ๋„ฃ์–ด ํ™œ์„ฑํ™” ์‹œํ‚ต๋‹ˆ๋‹ค. ์ง€๊ธˆ๊นŒ์ง€ ..
_์„ฑํ˜ธ_
'Frontend' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๊ธ€ ๋ชฉ๋ก (4 Page)