I do not understand where you are having issue but this should just work fine:
Note that I am using jQuery syntax as you have tagged jQuery in the question.
<asp:HiddenField ID="HiddenField1" runat="server" />
<script type="text/javascript">
$(document).ready(function () {
$("#<%=HiddenField1.ClientID %>").val("NewValue");
});
</script>
In the code behind, you can access the control by it's id like below:
string hiddenFieldValue = HiddenField1.Value;
Hope that helps!