Jquery change <p> text programmatically

Try the following, note that when the user refreshes the page, the value is "Male" again, data should be stored on a database.

$('button').click(function(){
     $('#pTest').text('test')
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.1/jquery.min.js"></script>

<p id="pTest">Male</p>
<button>change</button>