I have a very strange issue. Im not sure why the $.data not returning the correct value after updating the data attibute even though the element has the correct value in firebug.
Demo: http://jsfiddle.net/gv5cR/
<div>
<input type="text" name="price" id="price"/>
</div>
<button type="button" id="submit" data-price="100">Submit</button>
<div id="result"></div>
<script>
$(document).ready(function(){
$('#price').change(function(){
$('#submit').attr('data-price',$(this).val());
});
$('#submit').click(function(){
$('#result').html($(this).data('price'));
});
});
<script>
.data()itself?$('#submit').data('price',$(this).val());