How to call Javascript method in onLoad event?

Here I have the Javascript method called js_hideButton
console.log(‘hide back button’);

document.addEventListener('DOMContentLoaded', () => { 
    document.getElementById('Bsair_t').style.display = 'none';

I call it in the onLoad event

It shows an error in the whole form.

1 Like

I have a similar issue
I had JS code in my onload that has been working until recently. Now when I run the app, it does not do anything, as if it were not there.
I am trying to change the color of text based on the #applications:grid-reports
Is it possible sc changed something in the last update?

here is the code, I have in onLoad

		#id_StyleViewNew_form4 a{
		  color:  lightgray;
		  font-style: italic;

		{content: "<?php echo "" ?>";