Skip to content

Instantly share code, notes, and snippets.

@vly
Created October 9, 2013 23:16
Show Gist options
  • Save vly/6910198 to your computer and use it in GitHub Desktop.
Save vly/6910198 to your computer and use it in GitHub Desktop.
create an edit button. Paste into the Console.
var test = function() {
var a = $('.answer-official-heading').parent(),
_id = a[0].getAttribute('id').split('-')[1],
_url = window.location.pathname;
_url += '/answers/' + _id + '/edit';
a.children()[1].insertAdjacentHTML('beforeend', '<span class="answer-published"><a href="' + _url + '">Edit</a></span>');
};test()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment