getElementsByClassName() returns a HTMLCollection so you need to iterate through the results.
var elements = document.getElementsByClassName("PSLEVEL1GRIDODDROW");
for(var i=0, l=elements.length; i<l; i++)
elements[i].style.textAlign = "center";
I found a scenario where it would be nice to automatically copy text from a PeopleSoft page and place it into the Clipboard.
Here is how you can do it…
1. Add an HTML element to a page and change it to “Constant”
This only works in IE but you could write it for cross-browser support.
I added this to copy the XML Schema from the message definition schema page.
This hides a button till another object on the page appears…
I also added a group box around another object so it would give a unique id to a dynamic object. (win0divHRS_CE_LNK_WRK_PAGE_9)