<button id="redirect" onclick="" type="submit" class=""> Текст </button>
<a id="redirect" onclick="" type="submit" class=""> Отмена </a>
replace_tag($('button'), 'a'); function replace_tag(node, replacementTag){ node.each(function() { var outer = this.outerHTML; var regex = new RegExp('<' + this.tagName, 'i'); var newTag = outer.replace(regex, '<' + replacementTag); regex = new RegExp('</' + this.tagName, 'i'); newTag = newTag.replace(regex, '</' + replacementTag); $(this).replaceWith(newTag); }); }