엘레먼트에 다이렉트로 변수,배열,객체 심기
아마 이렇게 사용하는 사람을 저 밖에 못 본 것 같은데...
엘레먼트에 다이렉트로 변수에 문자열이나 배열이나 객체를 심는 방법입니다.
예제변수는 mode 로 네이밍해 봤습니다.
<div id="my">그누보드</div>
<script>
document.querySelector("#my").mode = "비타주리";
document.write(document.querySelector("#my").mode);
</script>
아래처럼 배열이나 객체(내지는 연관배열)을 심을 수도 있습니다.
document.querySelector("#my").mode = ["비타주리"];
document.querySelector("#my").mode = {name : "비타주리"};
게시판 목록
개발자팁
개발과 관련된 유용한 정보를 공유하세요.
질문은 QA에서 해주시기 바랍니다.
질문은 QA에서 해주시기 바랍니다.
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 4946 | node.js | 6년 전 | 2609 | ||
| 4945 | node.js | 6년 전 | 2380 | ||
| 4944 | node.js | 6년 전 | 2520 | ||
| 4943 | node.js | 6년 전 | 2271 | ||
| 4942 | node.js | 6년 전 | 2247 | ||
| 4941 | node.js | 6년 전 | 2719 | ||
| 4940 | node.js | 6년 전 | 1867 | ||
| 4939 | node.js | 6년 전 | 1995 | ||
| 4938 | node.js | 6년 전 | 2459 | ||
| 4937 | node.js | 6년 전 | 2250 | ||
| 4936 | node.js | 6년 전 | 2321 | ||
| 4935 | node.js | 6년 전 | 2136 | ||
| 4934 | node.js | 6년 전 | 2441 | ||
| 4933 | node.js | 6년 전 | 2247 | ||
| 4932 | node.js | 6년 전 | 2687 | ||
| 4931 | node.js | 6년 전 | 2070 | ||
| 4930 | node.js | 6년 전 | 1999 | ||
| 4929 | node.js | 6년 전 | 8631 | ||
| 4928 | node.js | 6년 전 | 3749 | ||
| 4927 | node.js | 6년 전 | 2393 | ||
| 4926 | node.js | 6년 전 | 2504 | ||
| 4925 | node.js | 6년 전 | 2082 | ||
| 4924 | node.js | 6년 전 | 3374 | ||
| 4923 | node.js | 6년 전 | 2221 | ||
| 4922 | node.js | 6년 전 | 1989 | ||
| 4921 | node.js | 6년 전 | 2046 | ||
| 4920 | node.js | 6년 전 | 1764 | ||
| 4919 | node.js | 6년 전 | 2031 | ||
| 4918 | node.js | 6년 전 | 2178 | ||
| 4917 | node.js | 6년 전 | 2395 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기