Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Salesforce
  3. Question
Salesforce

Why document.getElementById(“something”).value not working for with not working after Locker Service enabled?

Asked by Isha Patil Aug 17, 2021 3.7K views 2 answers
Share

About this question

The document.getElementById("something").value in my controller on HTML tag  is not working after Locker Service is enabled. I did console.log() and it's returning nothing.

Any idea how to overcome this issue? Any idea why document.getelementbyid not working?

Help is very much appreciated.

 

HTML markup :

<select class="form-control picklist" onchange="{!c.filteredProducts}" name="Discount__c" id="discount"> </select>

And the javascript function:

filteredProducts: function(component,event,helper) { var discount =document.getElementById("discount").value; }

Your answer

2 Answers

Russelltedelson Latest answer

Answered on Jun 10, 2025

For anyone experiencing similar issues, always double check your element IDs and make sure they match just like perfecting your moves in geometry dash lite

Was this helpful?

More Salesforce discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Salesforce Blogs

Guides, tips and career advice on Salesforce from JanBask experts.