<button pButton type="button" label="Редактировать" style="width:auto"></button>
<button pButton type="button" data-secondname="Сохранить" style="width:auto">Редактировать</button>
document.querySelectorAll("button").forEach(function(el){
el.addEventListener("click",function(){
if(!this.dataset.secondname)
return;
var tmp = this.innerHTML;
this.innerHTML = this.dataset.secondname;
this.dataset.secondname = tmp;
},false)
})