Skip to content

Instantly share code, notes, and snippets.

@onyxfish
Created May 20, 2013 20:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save onyxfish/5615173 to your computer and use it in GitHub Desktop.
Save onyxfish/5615173 to your computer and use it in GitHub Desktop.
Example demonstrating how to extract SVG from the DOM and populate a hidden form input.
var $hidden_input = $('input[name="svg_body"]');
var $svg_root = $('svg#preview');
var svg = $svg_root.html();
$hidden_input.val(svg);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment