Reference/Print data within an Element ID into <script> code

I’m not a professional web designer by any means, so any tips are very helpful! I’ll try the code you reccomended. What APi should I use, and are there any resources on how I can learn more about it?