王奕然
王奕然

Reputation: 4059

<s:a> attribute disabled not working

i use struts2 like:

<s:a id="beforePage" disabled="true">beforePage</s:a> 

but disabled doesn't work,it is the same as without disabled attirbute.

To my surprise,when i use jquery,like:

<s:a id="beforePage">beforePage</s:a> 
$("#beforePage").attr("disabled","true");

the disabled attribute work! so,i'm confused on it.. please give me an explanation for that,thanks a lot.

Upvotes: 0

Views: 706

Answers (2)

Manmohan
Manmohan

Reputation: 146

Struts2 <s:a> tag finally generates html <a> tag. There is no "disabled" attribute defined intag (i.e.` does not support disabled attribute). Hence it is not working.

Upvotes: 1

Rob G
Rob G

Reputation: 3526

The disabled attribute in the more recent versions of HTML is simply to exist in the element, like such, or as the attribute's value as well:

<s:a id="beforePage" disabled="disabled">beforePage</s:a> 

Upvotes: 0

Related Questions