I am trying to add javascript to the standard layout in order to hide a button based on a condition. I have created a VF page with the java script and added that page to a section in the standard layout. However, the script doesn't work because it doesn't seem to have access to any of the UI elements. I initially suspected that the script may be loaded before the DOM but that doesn't seem to be the case. I tried to run the same script via the browser console and it seems to work fine. I am not able to figure out why the UI elements are not accessible to the script. Any thoughts and ideas are welcome .
Thanks, neel