How to return value found through HTML code

Hello all,
I am trying to retrieve these numbers and save them to my database for formatting.
tslast

I got these numbers by running this script through my HTML element. It simply is a button with a function that gets clientHeight which is the rendered height of my HTML element.

I thought a way I could retrieve this value is by running a java script and then running a javascript to element then find and save the value to my database using the toolbox plugin.

But when I run the javascript through a button click.

I then receive this error when I run it through my app.

I will admit I got it to work when I add a ID attribute to my html and change ‘document.getElementById’ to ‘document.querySelector’ but it does not give me the same numbers as the script I wrote directly into the HTML.

Summary. 1.Is there a better way of pulling data from my HTML script?
2. Why is document.getElementById not pulling the id I put into the HTML.
3. Why does javascript only work when I replace document.getElementById with document.querySelector.

@mishav

1 Like

Did you ever find a solution for this?