Is there any tool / library which would:
- Take HTML markup as input
- Auto-generate a jQuery script which, in return, if executed, would
- Generate the original HTML?
As I wrote in comment, It depends on how complex your HTML is.
If there's something pretty simple, then
$('<div class="content">...</div>')
will return your HTML as DOM element already wrapped in jQuery. Otherwise (if you have scripts, events etc) you'll need to use $.parseHTML (as mentioned by @emergence) and pass extra arguments.
Here's official doc for .parseHTML: http://api.jquery.com/jquery.parsehtml/
$('<div class="content">...</div>')will do.$.parseHTML(...)should help you as well. api.jquery.com/jquery.parsehtml