更新时间:2023-12-04 23:42:52
简短答案:您不能/不可以.但是你可以让自己看起来像个样子.
Short answer: You can't/don't. But you can give the appearance that you are.
更长的答案:示例
$(function(){
$("#inputtext").keypress(function(e){
var valueofinput= $(this).val();
if(e.which==13)
{
$('#inputtext').before('<span class="tag">' + valueofinput + '</span>');
$('input').val('');
}
});
$(document).on('click', '.tag', function(){
$(this).remove();
});
$('.inputholder').click(function() { $('#inputtext').focus(); });
});