开发者

How do I write selected jQuery DOM elements back out as XHTML snippets?

I'm wanting to select some DOM elements using jQuery, modify some attributes, and开发者_如何学运维 then write the DOM elements back out as xhtml snippets for post processing. I want the resulting xHTML to have only the attributes specified in the original page html plus the modifications I make with jQuery.

Is there an existing javascript library or API that can help me accomplish this task?


The outerHTML jQuery plugin gives jQuery support for what I think you're asking for - getting the full HTML for a given tag.

But watch out - you can't trust your user input on this. Any user can easily hijack the data you're going to send for "post-processing" and make it say whatever they want.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜