ampproject / ampproject/amphtml
Not able to access the elements inside the amp tags by using document.getElementById or document.getElementsByClassName
Open
Stale
Type: Bug
- Dominant language
- JavaScript
- Stars
- 14.9k
- Forks
- 4.1k
- PR merge metrics
- No merged PRs in 30d
Description
### Description
Not able to select the element inside the amp tags like amp-selector,amp-carousel by using the document.getElementById or document.getElementsByClassName. Always gets the null or empty array.
### Reproduction Steps
In code i am trying to access the select option. I want to make the city dropdown option selected based on the city user is in. I am getting null or empty array.
### Relevant Logs
_No response_
### Browser(s) Affected
_No response_
### OS(s) Affected
_No response_
### Device(s) Affected
_No response_
### AMP Version Affected
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.