javascript - 在 JSP 中使用 JavaScript 取消隐藏 HTML 行
问题描述
在 Spring MVC 中使用服务器数据显示 JSP 页面,我将数据从 Spring 发送到 JSP 页面,并且基于数据对象值需要取消隐藏另一行。
我的 JSP 页面的一部分:
<tr>
<td align="center"><select style="width: 300px" id="menu6" name="menu6" size=10 multiple>
<c:forEach var="categoryTwo" items="${dataObj.categorySubcategoryNameAndIds}" >
<option value="${categoryTwo.categoryTypeId}" categoryType="${category.categoryTypeId}" >${categoryTwo.feedCategoryOrSubCategoryName}</option>
</c:forEach>
</select><br /></td>
</tr>
<tr id="newRow" style="display: None">
<td>
something to show
</td>
</tr>
显示的数据来自服务器,是一个对象列表,基于一个对象成员的值,即 categoryType(int variable) 我必须取消隐藏 id='newRow' 的行。
问题是,我无法弄清楚将 categoryType 值推送到 javascript 函数的方法。
categoryType 的值应为 5 以取消隐藏 id='newRow' 的行
解决方案
推荐阅读
- python - 如何检查列表中元组中的第一个数字?
- node.js - 在 AWS Lambda 中读取事件流时出现问题。Nodejs 代码根据需要在本地工作,但不在 AWS Lambda 中
- python - 确定重叠日期范围内时间块的最大并发性
- css - Wordpress 页面外的文本
- javascript - 页脚不在原地 (React-Gatsby)
- .net - HttpGet ActionResult 方法并非所有代码路径都返回值
- powershell - 一批在一条线上有不同的颜色?
- python - 不理解 Python 中非覆盖描述符的默认实现
- javascript - Material UI - 选择选项后如何消除对自动完成的关注?
- android - TextInputLayout 标签干扰输入的文本