为什么与用户完成输入或单击离开输入时相比,此更新不实时更新?
$(document).ready(function() {
$("input[id^='ralph']").change(function() {
var currentId = $(this).attr('id');
var currentValue = $(this).val();
//Billing
var elements = currentId.replace('ralph','john');
$('.' + elements).text(currentValue);
//Shipping
var elements = currentId.replace('john','george');
$('.' + elements).text(currentValue);
});
});