Frontend/jQuery & JSTL
[JSTL] 페이지 작업
Mr.6_냥아치
2023. 11. 22. 15:34
반응형
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>
...
반응형