Skip to content

Instantly share code, notes, and snippets.

@alexmcpherson
Created August 28, 2012 22:22
Show Gist options
  • Save alexmcpherson/3504868 to your computer and use it in GitHub Desktop.
Save alexmcpherson/3504868 to your computer and use it in GitHub Desktop.
Mustache
var hostnameRow = '<tr data-hostname="{{hostname}}"><td><input type="hidden" name="hostnames[]" value="{{hostname}}"/>{{hostname}}&nbsp;&nbsp;<span onclick="removeHostname(\'{{hostname}}\')">Remove</span></td></tr>';
$("#hostnameTable").append(hostnameRow.replace(new RegExp('{{hostname}}', 'g'), hostname));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment