+ 4

How can I reload only one div of a webpage on click in HTML?

I didn't linked a code as I don't have any idea on how to reload just a part of the webpage. Please help me to do it. Hope you will help !

29th Apr 2022, 6:26 AM
Arnav Gumber
Arnav Gumber - avatar
5 odpowiedzi
+ 3
Code Infinite with Arnav Do you want to refresh a particular div? if so then you can do this: $("#" + divId).load(location.href + " #" + divId + ">*", "");
29th Apr 2022, 10:17 AM
A͢J
A͢J - avatar
+ 6
Use var div = document.querySelector("div"); div.innerText = value; to update the inner text of the first div https://code.sololearn.com/WPkU2vMbU9GB/?ref=app
29th Apr 2022, 6:50 AM
Calviղ
Calviղ - avatar
+ 4
Also elm can do it.
29th Apr 2022, 10:36 AM
Oma Falk
Oma Falk - avatar
+ 2
It's not as that as I want. It's just incrementing it's value simply, I want to reload the div. But I think it's possible in react or Angular.
29th Apr 2022, 6:59 AM
Arnav Gumber
Arnav Gumber - avatar
+ 2
Yes use react or angular good luck
29th Apr 2022, 8:44 AM
Chris Coder
Chris Coder - avatar