# Can I use onClick to just go to a URL

**URL:** https://forum.kirupa.com/t/can-i-use-onclick-to-just-go-to-a-url/266691
**Category:** web dev
**Created:** [July 23, 2008, 2:47pm UTC](https://forum.kirupa.com/t/can-i-use-onclick-to-just-go-to-a-url/266691 "2008-07-23T14:47:05Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![somnamblst](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@somnamblst](https://forum.kirupa.com/u/somnamblst)
#### Post date: [July 23, 2008, 2:47pm UTC](https://forum.kirupa.com/t/can-i-use-onclick-to-just-go-to-a-url/266691/1 "2008-07-23T14:47:05Z")

</div>

OK I admit I am violating CSS by wrapping an HREF around a div but I have done this before with full knowledge that it is not done but it worked in other instances including empty divs & nested divs with other javascript widgets like Hide All except One with no problem.

The one that this is not working is a javascript scroller based on this example.  
[http://jscroller2.markusbordihn.de/example/](http://jscroller2.markusbordihn.de/example/)

My HREF does click thru in FF but not in IE.

Could I try something like

```auto
<a href="http://yahoo.com" OnClick="MyFunction(getURL);" title="Click here">

```
