My answer is on the guess that you want to do this in Asp.Net.
You do not need
UpdatePanel
for HTML controls. Infact
UpdatePanel
is for Server controls only.
However you may use traditional/core
Ajax to execute server side code from your Html/JavaScript.
Have a look at my Tip/Trick on this topic below. (not an advertise :))
Simplifying Asp.Net Core Ajax