✍️ jquery
✏️ jquery로 html tag에 접근하기
1. jquery를 이용해 html 요소'id' or 'class' content에 접근하기
let id = $('#id').val();
let className = $('#class').val();
❗️❕ 주의사항 ❗️❕
jquery 이용시 jquery 관련 <script> 붙일 것
2. jquery를 이용해 <ul> 태그에 입력 값 붙이기 및 초기화하기
📦 준비물
jquery <script> 태그 html code에 붙어 있을 것
<form>
<input id="input" type="text" placeholder="여기에 이름을 입력"/>
<button>제출</button>
</form>
<ul id="list">
<li>세종대왕</li>
<li>임꺽정</li>
</ul>
let input = $('#input').val();
let temp_html = `<li>${input}</li>`
$('#list').append(temp_html)
✏️ json
사용자가 서버에 요청해서 데이터를 받아올 때 해당 데이터의 양식이 있는데 이를 json이라 한다.
json 파일은 아래와 같은 형태를 띄고있다.
{
"_comment": "아래",
"RealtimeCityAir": {
"list_total_count": 25,
"ROW": {},
"ROW": [{...}, ... {...}],
}