-1

如何在 JavaScript 中使用 El 标签?我不想在 javascript 函数中使用类作为标识符我想在 Javacript 中使用 El 表达式 下面的代码运行良好,唯一的问题是我不了解如何在 javascript 中使用 El 代替 id。请帮我

<html>

    <c:forEach items="${studentsList.students}"
        var="student">

    <script type="text/javascript">
    $(document).ready(function(){
      $( here i want to use el value as id ).keyup(function(){

    //do something

      });

});
</script> 

</c:forEach>


//Dynamic list of input boxes each having id of particular student

<c:forEach items="${studentsList.students}"
    var="student">
<input type="text" id="{student.id}">

</c:forEach>


</html>
4

1 回答 1

0
$("<c:out value="${yourVariable}"/>").keyup(function(){

    //do something

});
于 2013-07-31T12:43:12.583 回答