# How to return value found through HTML code

**URL:** <https://forum.bubble.io/t/how-to-return-value-found-through-html-code/87042>\
**Category:** Plugins\
**Created:** [April 17, 2020, 4:54pm UTC](https://forum.bubble.io/t/how-to-return-value-found-through-html-code/87042 "2020-04-17T16:54:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hiyspyservices](https://avatars.discourse-cdn.com/v4/letter/h/e0b2c6/32.png) [@hiyspyservices](https://forum.bubble.io/u/hiyspyservices)\
**Post date:** [April 17, 2020, 4:54pm UTC](https://forum.bubble.io/t/how-to-return-value-found-through-html-code/87042/1 "2020-04-17T16:54:20Z")

</div>

Hello all,  
I am trying to retrieve these numbers and save them to my database for formatting.  
 ![tslast](https://us1.discourse-cdn.com/bubble/original/3X/4/f/4fab1798c9dd078840af08e4ef4115f513fb12e2.jpeg)

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.

 ![ts3](https://us1.discourse-cdn.com/bubble/original/3X/2/3/23d23402bcc06c58486926ccba4e3b77651ff220.jpeg)

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.

 ![TS1](https://us1.discourse-cdn.com/bubble/original/3X/a/d/adce044d33ce2221473feb12bb8f315b1bd41010.jpeg)

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

 ![ts2](https://us1.discourse-cdn.com/bubble/original/3X/6/c/6c68f9f798b5ab55d8c01c967ca57c05be508125.jpeg)

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

---

<div class="post-metadata">

**Author:** ![bryan\_333](https://avatars.discourse-cdn.com/v4/letter/b/8e8cbc/32.png) [@bryan\_333](https://forum.bubble.io/u/bryan_333)\
**Post date:** [February 26, 2021, 6:46am UTC](https://forum.bubble.io/t/how-to-return-value-found-through-html-code/87042/2 "2021-02-26T06:46:14Z")

</div>

Did you ever find a solution for this?
