jQuery改变输入的值并将其显示为文本
jQuery change value of input and display it as text
我正在努力解决以下问题。我有一个输入文本元素。我希望用户在那里输入一些东西,然后他的值显示为正常文本(输入应该消失)。
我寻找了一些解决方案,但没有一个对我有效。我所尝试的(无论我提供什么函数,我都没有得到结果,我应该提供什么来获得我上面描述的效果以及如何实现它?):
$('input.modified').on('input', function(){
(this).append('<p>some</p>');
});
或
$("input.modified").bind("propertychange change keyup paste input", function(){
$(this).append("<p>dgdgd</p>");
});
或
$("input.modified").change(function(){
$(this).css("visibility","hidden");
}); //end change function
如何使函数像。on()或。change()与我的代码工作?
谢谢你的回答,但是我不能把你的例子移到我的代码中:(
请确认我遗漏了什么:
[http://jsfiddle.net/w6242/][1]
检查这个演示