我正在尝试制作一个 hta(html 应用程序),您可以在其中将名称添加到数组中,然后找出某个名称是否在数组中。当我关闭并重新打开 hta(或刷新 html)时,没有保存任何名称。我如何做到这一点,以便当我运行添加名称的函数时,代码与其中包含名称的变量一起保存。
这是添加名称的功能
    var names = []
    function addName(first, last){
    names.push(first + " " + last)
}
function realAddName(eventObject){
    var addFirstName = document.getElementById("addFirstName")//the input box for the first name
    var addLastName = document.getElementById("addLastName")//the input box for the last name
    addName(addFirstName.value, addLastName.value)
    alert("The name you input is now added to the thing.")
} 
我没有 jQuery,所以不要给我使用 jQuery 的答案。
请帮我。