I already wrote that when I run the javascript script, I have a window with the contents of the disk with: / alt text

I was advised to insert 2 lines into the function

window.event.returnValue = false; window.event.cancelBubble = true;

and it helped, but there is one thing. It annoys me every time to insert these lines into a new function.

Someone can tell how to get everything back, because before that I did not have to enter these lines each time for a new function.

    1 answer 1

    From the past question:

    <a href="/" onClick="elements()">elements html</a> 

    Why do you use "/" in href? What is the purpose? If you do not need to follow the link, use

     href="#", href="javascript:;", href="javascript:void(0);" 

    or whatever. If you need to put the link in the root of the site - write the full path there

     href="somesite.com/" 

    Or specify in the head

     <base href="somesite.com/" target="_blank"> 

    and then use the links as used

     <a href="/" onClick="elements()">elements html</a>