tags:

views:

20

answers:

2
<input type="hidden" value="" id="myhidden">

Iam getting the Value of Button Value using data-value attribute from button

var myvalue = $(this).attr("data-value");

I have to pass the "myvalue" to the hidden value

$("#myhidden").attr("value","??????????????");

when i have passed "myvalue" It is not acccepting

+1  A: 
var myvalue = $(this).attr("data-value");

$("#myhidden").val(myvalue);

to check if it's there, you could try alert($("#myhidden").val()); after setting the value...

Reigel
A: 

$("#myhidden").attr("value",myvalue).serialize();

Someone
`.serialize()` ?
Reigel
We are getting the object and iam converting it to a value
Someone
From your Original Post, I don't think you're getting an object... is `alert(myvalue);` alerting an `[object]` ?
Reigel