I'm using master pages in .NET and I've discovered that I can't use ID's to retrieve values because .NET adds in it's own id values. See this very helpful article! [Can't get JQuery to work in Master Page](https://stackoverflow.com/questions/841964/cant-get-jquery-to-work-in-master-page) 

So I went through and added classes to all the relevant fields, however I ran into a problem when it came to my hidden field `<asp:HiddenField ID="softwareSelected" value="" runat="server" />`

I can't add a class into it, and after more Googling I saw that people fix it by calling `clientID`. 

So I tried this: 

```
var myHidden = document.getElementById('<%= softwareSelected.ClientID %>');
console.log(myHidden.value);
alert(myHidden.value);

```

Using this answer: [ASP.NET set hiddenfield a value in Javascript](https://stackoverflow.com/questions/13454985/asp-net-set-hiddenfield-a-value-in-javascript) 

However it isn't returning any value, just an empty alert and console.log. 

Could someone point me in the right direction? This is driving me nuts!

EDIT

I set this higher up in my code: 

```
<asp:HiddenField ID="softwareSelected" ClientIDMode="static" value="test" runat="server" />

```

By putting the ClientIDMode to static I'm getting back `undefined`

Then I try and overwrite this value like this: 

```
var myHidden = document.getElementById('<%= softwareSelected.ClientID %>').value;
console.log(myHidden.value);
 myHidden.value = "tester123";
 console.log(myHidden.value);

```

But I still get `undefined` :/