Hard to say for sure without fiddling around a bit and/or seeing your page.
But I can tell you that's not how to get the value, and that technically speaking only form elements may have attribute values (they don't have to be in forms though), and that technically it's a property, not an attribute. It's both really, except that once the page is loaded, the attribute should remain the same regardless of user interaction and/or javascript effects, the property can be changed.
That all said, if what you have is a form element (input, select, textarea, radio button, checkbox), and it does have some value, here's how to get its value in jQuery:
Code:
var myVar = $('#elmid').val();
Bookmarks