I would like to consider a case that i have an html page and I would want to parse element’s information using javascript and using it for #googleanalytics tracking
However I have a concern is it better to have element id’s specified for each area of an html page for parsing through javascript/jquery? Is it advisable? Does it has any impact on page load time?
Example : I have an page where I have around 6-8 (may be more) areas to be populated with certain information and use such information to be tracked in google analytics based on user’s interaction i.e. user clicked on a particular area
Please let me know your suggestions. And if I need to provide more information. Thanks
The downside is you’re adding characters to your html.
The upside is it makes whatever code you write much easier to maintain. In the end it’ll likely decrease the size of the page overall, as instead of having to do gnarly DOM traversal contortions, you have
document.getElementByIddoing all of that for you. Alsodocument.getElementByIdis fast.Use IDs. Just don’t repeat them.