How can i make the input of an input textfield appear like output (this may be in another input field or just in html), when a button is clicked? Thanks in advance开发者_开发技巧!
Put in another textbox:
$('#outputTextBox').val($('#inputTextBox').val());
Append html to a div:
$('#outputDiv').append($('#inputTextBox').val());
<input type='text' name='myinput' id='myinput' />
<input type='submit' onclick='return handleSubmit();' />
<div id='myoutput'></div>
Then in js:
function handleSubmit()
{
$('#myoutput').append($('#myinput').val())
return false;
}
精彩评论