开发者

remove checked attribute from htmlgenericcontrol

开发者 https://www.devze.com 2023-03-20 10:23 出处:网络
I\'m using jquery plugin which need list items to be like: <input name=\"star3\" type=\"radio\" class=\"star\" checked=\"checked\"/>

I'm using jquery plugin which need list items to be like:

<input name="star3" type="radio" class="star" checked="checked"/>

I added runat="server" to that. Is there a way to remove on codebehind checked attribute (not change it, just remove it). It is now htmlGenericControl as I suppose.开发者_运维技巧

thanks for help


Try this

$("input:radio[name='star3']").attr("checked", false);

OR

$("input:radio[name='star3']").remoevAttr("checked");


You can do

htmlGenericControl1.Attributes.Remove("checked") 

or if the server control has an id like this

<input name="star3" type="radio" class="star" checked="checked" 
                                runat="server" id="radio1"/>

you can do

radio1.Attributes.Remove("checked");
0

精彩评论

暂无评论...
验证码 换一张
取 消