views:

142

answers:

2

Consider a hiddenfield in the page HfId

<input type="hidden" id="HfId"/>

How to assign,clear and get value of a hidden field in jquery? ANy suggestion...

+2  A: 
$("#HfId").val("pony");
var x = $("#HfId").val();
svinto
+3  A: 

Should work:

$val = $("#HfId").val(); //Get
$("#HfId").val("");      //Clear
$("#HfId").val($newVal); //Set
Bobby
@bobby that worked...
Pandiya Chendur