본문 바로가기
Developer/HTML & JSP & CSS

[JSP] HTML요소 값으로 활용하기

by 순수한소년 2022. 2. 24.
728x90
반응형

@

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<script>
$(document).ready(function(){
    $(document)
        .on('keypress','#unifiedSearch'function(e) {
            /* 통합검색 엔터 */
            if ( e && e.which === 13 ) {
                console.log("엔터로 검색");
                e.preventDefault();
                $("#a_schAll").trigger("click");    // 통합검색 버튼
            }
        })
        .on('click','#searchKw'function(e) {
            e.preventDefault();
            var $this = $(this);
            $("#searchKeywordWhole").val($this.attr("data-searchKw"));
    });
})
</script>
 
<html>
    <dl class="tag">
        <dt class="tit03">TEST</dt>
        <dd>
            <c:forEach items="${popularList}" var="result" varStatus="status">
                <a href="#btnRound" class="btnRound" id="searchKw" data-searchKw="${result.keyword}">${result.keyword}</a>
            </c:forEach>
        </dd>
    </dl>
</html>
cs

@

728x90
반응형