Support Team
posted this
08 May 2025
Hello Jim,
Thanks for contacting us.
We recommend using a class instead of an ID here, as most elements already have an ID assigned, and since an ID must be unique, it's better to use more flexible selectors when working with multiple elements.
You can access the element like this:
document.getElementsByClassName("myAddedClassName") - returns all elements with that class name.
document.querySelector(".myAddedClassName") - returns the first element with that class name.
document.querySelectorAll(".myAddedClassName") - returns all elements with that class name (as a NodeList).
Feel free to choose the one that fits your use case best! If you have any other questions or need further assistance, please let us know.
...................................................
Sincerely,
George.
Nicepage Support Team
Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1
Follow us on Facebook: http://facebook.com/nicepageapp