Using LESS CSS I was able to restrict entire stylesheets to acting on a specific div element. I would like to restrict entire javascript files to a specific div element on my page.
For example, a js file that is bootstrapped at the head of the page has code the manipulates table elements in the DOM. It does its job but also does ALL table elements on the page not the one specific one I wanted. Now the practical soultion is to change all ofthe respective jquery selectors to a more specific identifier. I know that. But there is mountains upon mountains of code and that is not feasible to do.
Is there a way to restrict javascript/jquery code to a specific div?
I want to avoid using iframes also.
Thanks.