Here is a functional demonstration of your request: http://jsfiddle.net/ALLew/
In this illustration:
- All unordered lists appear in yellow color.
- Elements with the class name rtsULmenuLeft are highlighted in red.
- Elements with the class name rtsULmenuRight are displayed in blue.
Upon inspection, you will notice that the rtsULmenuLeft classes have been eliminated, and now the lists are presented in yellow.
// Define a function to execute upon page load.
var loadCheck = function() {
// Ensure the page has loaded completely before proceeding...
if(document.readyState !== "complete") {
// ... else, re-run the function after 100 milliseconds.
setTimeout(loadCheck, 100);
return;
}
// At this point, the page has finished loading.
// Gather all elements with the specified class name
var elList = document.getElementsByClassName("rtsULmenuLeft");
// Iterate over the elements until no more items have this class.
while(elList.length > 0) {
// Remove the class for each element.
elList[0].className = elList[0].className.replace(
/\brtsULmenuLeft\b/, // Matching class name within word boundaries
"" // Replace with an empty string to remove it.
);
}
};
loadCheck();