Comments (2)
과거 status
는 window.status
속성으로 윈도우 하단에 표시되는 상태 바의 메시지를 설정할 때 사용했습니다.
하지만 오늘날 이는 사용되고 있지 않습니다. 대부분의 모던 웹 브라우저에서 하단 상태 표시바를 기본적으로 보이도록 설정하지 않고, 상태 변경 시에만 잠깐 보이도록 변경했기 때문인데요. (과거 상태 표시 줄이 악용 되던 경험 때문에)
변수로 status
이름을 사용하기 보다는 다른 이름을 사용하길 권장하지만, Chrome의 경우 아래 이미지처럼 개별 설정이 가능하기는 합니다. 웹 브라우저마다 차이가 있을 것으로 생각되네요. 가급적 변수 이름으로 status
그대로 사용하기 보다는 currentStatus
혹은 visible_status
등으로 사용하는 것을 권장드리고 싶습니다.
그리고 JavaScript 키워드/예약어 는 다음과 같습니다.
abstract, arguments,
boolean, break, byte,
case, catch, char, class, const, continue,
debugger, default, delete, do, double,
else, enum, eval, export, extends,
false, final, finally, float, for, function,
goto, ,
if, implements, import, in, instanceof, int, interface,
let, long,
native, new, null,
package, private, protected, public,
return,
short, static, super, switch, synchronized,
this, throw, throws, transient, true, try, typeof,
var, void, volatile,
while, with,
yield
from jj_camp_fundamental.
예약어는 아니군요?
그런데 아래 소스인데 감추는건 되는데 보이기는 안되요. 크롬이구요..
변수 status를 currentStatus로 바꾸면 잘됩니다.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body lang='KO-KR'>
<p class='memo'>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip.</p>
<button type='button' class='button'>toggle</button>
<script>
var memo = document.querySelector('.memo');
var button = document.querySelector('.button');
var status = true;
button.onclick = function() {
if (status) {
memo.style.display = 'none';
status = false;
}
else {
memo.style.display = 'inherit';
status = true;
}
}
</script>
</body>
</html>
from jj_camp_fundamental.
Related Issues (20)
- 야무쌤 안녕하세요! 수강생 전태헌입니다. HOT 1
- (git) fetch와 push는 뭔가요? HOT 1
- 맥 추천 좀 부탁합니다. HOT 2
- 설치한 git desktop 프로그램은 github만 되나요? HOT 1
- 마케팅 랜딩페이지가 뭔가요? HOT 1
- 변수 참조 질문입니다. HOT 1
- 키노트는 어디서 볼수있나요? HOT 1
- 토글버튼후 페이지이동시 유지 HOT 1
- 연산자 HOT 1
- querySelector 가 getElementById보다 느린가요? HOT 1
- typeof 로 데이터형식 확인하는 것이 왜 좋지 않나요? HOT 1
- 장치 UI HOT 1
- 교재 선별 부탁드립니다. HOT 1
- 속성 visibility HOT 2
- groupCollapsed / groupEnd 는 뭔가요? HOT 1
- setAttribute HOT 1
- 뮤직플레이어요 HOT 1
- 가운데 위치시키기 HOT 3
- cover 파일 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jj_camp_fundamental.