我正在从一个工作得很好的文件中渲染 dom。然后我使用带有点击事件的 jQuery 操作 dom。
我的问题是:我现在如何从后面的代码中获取被操纵的元素?
$(document).ready(function() {
var x = $(".class");
x.on("click", function() {
$(this).addClass("editable");
});
});
public static string filePath = HttpContext.Current.Request.PhysicalApplicationPath;
public static string file = filePath + "/templates/index.html";
public CQ dom = CQ.CreateFromFile(file);
protected void Page_Load(object sender, EventArgs e)
{
var html = dom.Render();
if (!IsPostBack)
{
Response.Write(html);
}
}
protected void btnSave_OnClick(object sender, EventArgs e)
{
var editable = dom.Select(".simplecms.editable").Text();
// Obviously this string will contain the value from the original dom, how can I retrieve the manipulated dom here?
}