# Page scrolls up on javascript popup

**URL:** https://forum.kirupa.com/t/page-scrolls-up-on-javascript-popup/326840
**Category:** web dev
**Created:** [January 16, 2012, 12:11am UTC](https://forum.kirupa.com/t/page-scrolls-up-on-javascript-popup/326840 "2012-01-16T00:11:13Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Zenor](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/zenor/32/3634_2.png) [@Zenor](https://forum.kirupa.com/u/Zenor)
#### Post date: [January 16, 2012, 12:11am UTC](https://forum.kirupa.com/t/page-scrolls-up-on-javascript-popup/326840/1 "2012-01-16T00:11:13Z")

</div>

Hello, so I have this code on my link, which opens a popup window. Problem is when the link is clicked the page(not the external) scrolls up automatically. Any way to fix this?

```auto

<a href="#" onclick="window.open('test.html')">Link Test</a>

```
