I have a text box in a div:
<div id="divTest">
<input type="text" id="txtText">
</div>
Suppose the user types a word into the text box, I want a jquery method of getting the textbox HTML with the value that the user typed in. I have tried the below code:
$('#btnTest').click(function(){
alert($('#divTest').html());
e.preventDefault();
});
But this only gives me the HTML of the textbox, not the HTML + the value of the text within the textbox.
Here is a jsFiddle of the problem.