# HTML javascript is not getting executed.

**URL:** <https://community.hubspot.com/t/html-javascript-is-not-getting-executed/27948>\
**Category:** CMS Development\
**Created:** [November 12, 2020, 8:26pm UTC](https://community.hubspot.com/t/html-javascript-is-not-getting-executed/27948 "2020-11-12T20:26:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vandnakapoor19](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/vandnakapoor19/32/73373_2.png) [@vandnakapoor19](https://community.hubspot.com/u/vandnakapoor19)\
**Post date:** [November 12, 2020, 8:26pm UTC](https://community.hubspot.com/t/html-javascript-is-not-getting-executed/27948/1 "2020-11-12T20:26:29Z")

</div>

I am new in HubSpot Development. Excuse me if my query is very basic.  
I have created one onload JavaScript for HubSpot forms on Google Tag Manager & not able to console the information on the HubSpot form console. Any pointers, If I’m missing anything here

 ![34227iDF759906DF4CA168.PNG](https://d2qpr2jzcazej7.cloudfront.net/original/3X/6/1/61c16cf49de7199dcb6cd6dd85148ba8230a8ad9.png)

---

<div class="post-metadata">

**Author:** ![alyssamwilie](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/alyssamwilie/32/2072_2.png) [@alyssamwilie](https://community.hubspot.com/u/alyssamwilie)\
**Post date:** [November 12, 2020, 8:55pm UTC](https://community.hubspot.com/t/html-javascript-is-not-getting-executed/27948/2 "2020-11-12T20:55:52Z")

</div>

Heya @vandnakapoor19 ,  
If you want to trigger something on window load you would want to use GTM’s **Window Loaded** trigger instead of **Page View**. With **Window Loaded** set as the trigger then all you would need is the console.log bit in your script instead of adding an extra window event listener.
