jQuery.fn.replaceWith = function(replacement) {
  return this.each(function(){
    element = $(this);
    $(this)
      .after(replacement).next()
      .attr('href', element.attr('link')).attr('id', element.attr('id'))
      .html(element.html())
      .prev().remove();
  });
};

$('span.links234').replaceWith('<a></a>');