If you want to check if an id exists with javascript
let element = document.getElementById("myId");
if( element ){
// the logic here
}
If you want to check if an id exists with javascript
let element = document.getElementById("myId");
if( element ){
// the logic here
}