
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
서울온도가 20도 기준으로 높으면 더워요 낮으면 추워요를 출력하고싶은데 텍스트가아니라 숫자온도로만 표시가되는데
어느 부분의 코드를 고쳐야할까요??
$(document).ready(function () {
let url = "http://spartacodingclub.shop/sparta_api/weather/seoul"
fetch(url).then(res => res.json()).then(data => {
let temp = data['temp']
if temp > 20) {
console.log("더워요");
} else {
console.log("추워요");
}
$('#tp').text(temp);
})
})
