function getButtonName() { var newName = prompt( Rename the button, please ) document.myForm.myButton.value=newName } <input type = button name = myButton value = Click to rename me onClick= getButtonName() > Tracing through the DOM Replaces the old value with the new one.
{}