我使用struts2之类的:
<s:a id="beforePage" disabled="true">beforePage</s:a>
但是禁用不起作用,它与没有禁用attirbute的情况相同。
令我惊讶的是,当我使用jquery时,例如:
<s:a id="beforePage">beforePage</s:a>
$("#beforePage").attr("disabled","true");
禁用属性工作!所以,我很困惑.. 请给我一个解释,非常感谢。
答案 0 :(得分:1)
Struts2 <s:a>
标记最终生成html <a> tag. There is no "disabled" attribute defined in
tag (i.e.
`不支持禁用属性)。因此它不起作用。
答案 1 :(得分:0)
更新版本的HTML中的disabled属性只是存在于元素中,如此,或者也是属性的值:
<s:a id="beforePage" disabled="disabled">beforePage</s:a>