본문 바로가기

Frontend/jQuery & JSTL

[JSTL] 페이지 작업

반응형

span으로 지정된 값 가져오기

 

초기 값이 ""이기 때문에 document를 읽어온 후에 적용해야 한다.

<script>
...
$(document).ready(function() {
	var fYear = document.getElementById('chart-caption').innerText;
	var fYear = document.getElementById('chart-caption').innerHTML;
	var fYear = $("#chart-caption").text();
}
...
</script>
...
<span clas="tit" id="chart-caption" value="">${dataCode.dataCodeCaption}</span>
...

 

 

 

 

반응형

'Frontend > jQuery & JSTL' 카테고리의 다른 글

12/07 회고  (0) 2023.12.07
12/05 회고  (0) 2023.12.05
[jQuery] tab관리 작업  (0) 2023.11.17
[JSTL] data와 li요소 항목 비교해서 표시하기  (0) 2023.11.16
[jQuery] 백분위수 배열  (0) 2023.11.14