Если вы можете, используйте jQuery-эквивалент кода цинкорпа:
function changeButton()
{
$("input").each(function() {
if ($(this).attr("value") === "ButtonName") {
$(this).attr("value", "NewButtonName");
}
});
}
А если у вас jQuery 1.6 или выше, используйте «prop» вместо «attr».