I'm not an experience programmer in JavaScript and I'm struggling with reloading data in a specified DIV.
I have an example here. The original code is more complex I contains a calendar with disabled days. After the update new disabled days are calculated and should be listed in the calendar. However this example shows the issue. When clicking the button the text "Updated text" should appear instead of "Original text".
Any suggestions?
var bla = "Original text";
function js_updtest() {
bla = "Updated text";
$("#test").load(" #test");
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div id="inlay">
<div id="middle">
<div id='test'>
<script type="text/javascript">
document.write(bla)
</script>
</div>
<input type='button' value='Update' name='Updatetext' onclick='js_updtest();'>
</div>
</div>