# JS function variable passing

**URL:** <https://forum.kirupa.com/t/js-function-variable-passing/218414>\
**Category:** web dev\
**Created:** [March 7, 2007, 3:41pm UTC](https://forum.kirupa.com/t/js-function-variable-passing/218414 "2007-03-07T15:41:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Psaldorn](https://avatars.discourse-cdn.com/v4/letter/p/22d042/32.png) [@Psaldorn](https://forum.kirupa.com/u/Psaldorn)\
**Post date:** [March 7, 2007, 3:41pm UTC](https://forum.kirupa.com/t/js-function-variable-passing/218414/1 "2007-03-07T15:41:34Z")

</div>

Hi,  
This problem is REALLY bugging me now… esesntially when I try to pass information to a function it stops it working. I have NO idea why.

In the HTML (generated as PHP, not that it should matter):

```auto

<a href='#' onclick='hider(premade)'>== Pre-Made Parts ==</a>

```

In the JavaScript file:

```auto

function hider(targ){
   alert("x");
} 

```

If I remove the “premade” from the calling HTML it works fine. I’ve tried using all manner of quotes and speechmarks. I tried canging the name of the function, the name of teh variable it’s translated to… nothing. It must be something stupidly simple. Anyone care to be my second set of eyes?

Thanks in advance.
