I found a solution that works.
I gave the textbox an ID of "companyname", and I changed the setting saving code to:
var companyNameInput = document.getElementById("companyname");
localStorage["companyName"] = companyNameInput.value;
And here's what I used to load the setting:
var companyNameInput = document.getElementById("companyname");
var companyNameSetting = localStorage["companyName"];
if (companyNameSetting == null) {
companyNameInput.value = "";
}
else {
companyNameInput.value = companyNameSetting;
}