[英]How can I get value of itemLabel form JSP using javascript
如何使用javascript获取itemLabel表单JSP的值?
<form:radiobutton path="chosenInstitution" id="institution" itemLabel="${institution.name}" itemValue="${institution.id}"></form:radiobutton>
You can use getAttribute() method to get value of itemValue
like below :您可以使用getAttribute()方法来获取
itemValue
值,如下所示:
//getting attribute value var itemValue = document.getElementById("institution").getAttribute("itemValue"); //printing console.log("itemValue=" + itemValue);
<form:radiobutton path="chosenInstitution" id="institution" itemLabel="${institution.name}" itemValue="${institution.id}"></form:radiobutton>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.