is there a way to refresh one specific part/paragraph of a website without refreshing the entire website? [duplicate]

i have a website im working on that uses flask to run the website and mongodb to store data. on mongodb, i have a simple json collection with one value, which i increment (using python) whenever the user does something. i then use jinja2 to inject the data onto the website. while this does work, and the data shows on the website, you are forced to refresh the page in order to see the data count change.

this is how i inject the data into the website with jinja2:

<p>
<strong>amount: {{count['count_example']}}</strong>
</p>

the solution that i tried was refreshing the page automatically every 3 seconds using javascript:

setTimeout(function(){
    location.reload();
}, 3000);

while this does show the data changing, it produces a flickery effect and isnt the best solution. im wondering if there is a way to ONLY change/refresh the data count, which is located in a paragraph (i.e. <p>), without reloading the entire page. any help is appreciated.