function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Anna Lu 6Anna Lu 6 

Can we use Document.getElementById() in Lightning?

As the title. 
Given window. in JS cannot be used now in Lightning, can we still use document.getElementById() in Lightning? Thanks in advance. 
Raj VakatiRaj Vakati
It will not work if you enabled locker service. 

Refer below links 

https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/security_code.htm

You can do it by 

var discount = component.find("AURA-ID").get("v.value");
AURA-ID is compoent ID .