views:

67

answers:

1

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?

+1  A: 

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.

Matchu
That worked great! And thanks for the warning about the possible rewrite attacks.
Shane Holloway