How to retain a value using the select onchange when doing a refresh?

How to retain a value using the select onchange when doing a refresh?

I'm able to toggle the output the value, but when I hit refresh, the value is reset. I need the value to stay.

I'm able to toggle the output the value, but when I hit refresh, the value is reset. I need the value to stay.

function dateFunction() {
  var x = document.getElementById("ClaimContact").value;
  if (x == 0){                
    document.getElementById("answer").value = "Yes";    
  }
  if (x != 0){
    document.getElementById("answer").value = "No";
  }
}
<table width="100%" cellspacing="0" cellpadding="0" border="1" rules="rows" class="QuestionTable">
  <tr>
    <td #questionstyle# width="10%">Contact?</td>
    <td>
      <select name="ClaimContact" id="ClaimContact" onchange="dateFunction()">
        <option value=""></option>
        <option value="0">Y</option>
        <option value="1">N</option>
      </select>
    </td>    
    <td #answerstyle# align="right">
      <input type="text" id="answer" readonly style="border: none; text-align: right;">
    </td>
  </tr>
</table>


Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

JavaScript Table Filter or Search | How to add Filter In HTML CSS Table

How we can add a search or filter option in an HTML Table using ... Solution: JavaScript Table Filter or Search, Add Filter In HTML CSS Table.

How to create a simple Clock using HTML ,CSS & Javascript

In this project we will be learning to design a simple digital clock using HTML5, CSS3 and JavaScript.

How To Build A Captivating Presentation Using HTML, CSS, & JavaScript

Building beautiful presentations is hard. Often you're stuck with Keynote or PowerPoint, and the templates are extremely limited and generic. Well not anymore.