I have a the following html piece :
&l
all you have to do is :
fValue = $(input).attr("store-id");
your snippet is trying to add to the 'value' attribute of a div (which does not exist)
This works perfectly:
getComments = function(input) {
fValue = $(input).attr("store-id");
alert('the ID :'+fValue);
}
http://jsfiddle.net/mHBuE/
Take a look at jQuery custom selectors. Personally, I would use HTML5 data attributes for cases such as this which is already supported in jQuery.
For whatever it's worth, considering the parameter I believe what are you trying to originally perform should be done like
getComments = function(input) {
fValue = $(input).html( $(input).attr("store-id") );
alert('the ID :'+fValue.html());
}