我想查找并替换outerHtml内容。如何查找和替换jQuery中的outerHTML
有一个 “NSE_View_Delete” 类,我想用 “NSE_View_Delete_only_for_demo”
我怎样才能do..Please帮助..
这里是我的hiddenfield来代替它..
@Html.Hidden("ViewGroupDetails", Url.Action("ViewGroupDetails", "NSEDownload", new { acid = InsiderTrading.Common.ConstEnum.UserActions.NSEDownload }), new { @class = "gridtypecontrol", ctrtype = "link", gridcolumntype = @ViewBag.GridType + "_usr_grd_11073", param = "{'id':'MyID','class':'NSE_View_Delete','text':'','href':'" + Url.Action("ViewGroupDetails", "NSEDownload", new { acid = InsiderTrading.Common.ConstEnum.UserActions.NSEDownload }) + "& GroupId=<GroupId>','text':'View/Delete'}" })
它在DOM渲染为outerHTML(浏览器)如下
<input class="gridtypecontrol" ctrtype="link" gridcolumntype="508005_usr_grd_11073" id="ViewGroupDetails" name="ViewGroupDetails" param="{'id':'MyID','class':'NSE_View_Delete','text':'','href':'/NSEDownload/ViewGroupDetails?acid=223& GroupId=<GroupId>','text':'View/Delete'}" type="hidden" value="/NSEDownload/ViewGroupDetails?acid=223">
JS合作德为波纹管
if (obj.aData['nse_grd_50431'] != null) {
debugger;
var abc = obj.aData['nse_grd_50431'];
if(abc==0)
{
debugger;
var dom_value = $("#ViewGroupDetails").get(0);
var abc= dom_value.outerHTML.replace('param="class: NSE_View_Delete_only_for_demo;"')
alert(abc);
}
}
请帮助..
尽管此链接可能会回答问题,但请务必在此处提供答案的基本部分,并提供供参考的链接。这不是一个好的做法,因为如果链接及时中断,这个答案将不再有用。 – lealceldeiro