Get CustomField value with JavaScript

Matis Aas April 13, 2023

Hi all,

I'm trying to fetch CustomField value by using JavaScript in Announcement banner. However it always returns me null, can't figure this out. I thought that maybe JavaScript runs before the HTML elements are loaded and therefore it returns null, but even if I use jQuery to ensure HTML is loaded, it still returns null...
This is the method I use to get the value:
document.getElementById('customfield_10402') 


What I want to achieve is that when that field has a specific value, it displays an instructional popup message to the user(this part works). 


Regards,
Matis



0 answers

Suggest an answer

Log in or Sign up to answer