Trying to get the element through DOM accessor in amp-script
Tried to get element by classanme,id and queryselector but couldnot get element
var blogs = document.getElementById('home-blog-cards');
Expected the element but got some other data
Trying to get the element through DOM accessor in amp-script
Tried to get element by classanme,id and queryselector but couldnot get element
var blogs = document.getElementById('home-blog-cards');
Expected the element but got some other data
when using amp-script, you can get the elements inside amp-script
tag, because querySelector
is currently partially supported.
Check the official documentation: amp-script docs
Try updating :
const blogs = document.getElementById('home-blog-cards');