📅  最后修改于: 2022-03-11 15:04:24.053000             🧑  作者: Mango
jQuery(function($) {
var $firstname = $('input[name="firstname"]');
var $lastname = $('input[name="lastname"]');
var $fullname = $('input[name="fullname"]');
$firstname.add($lastname).keyup(function() {
$fullname.val($firstname.val() + ' ' + $lastname.val());
});
});