Getting a variable from javascript to HTML

I am working on a little project where I am using a raspberry PI to capture video and then analyse the human pose and display it on a webpage using machine learning. I am doing this using javascript. All is good so far but now I want to replicate the human pose on a physical robot that uses servo motors.

can someone kindly help me by suggesting how I can read the value of a variable within the javascript program and send to the HTML. I can then this value to control a servo motor through the GPIO pins on the raspberry PI.

I saw "getElementById" in a few places but don’t know how it works.

Thank you in advance.

18 thoughts on “Getting a variable from javascript to HTML”

Leave a Comment