I have my markup like this
<div class="text-input-area"> <input type="text" id="text-input"/> <br /> <input id="button" type="submit" value="Preview" /> </div><!--.text-input-area--> In the input area I will type only text. Now when I will click on button Preview it should show the text that I had type. For that I have made my jquery like this
<script type="text/javascript"> jQuery(document).ready(function() { jQuery('#button').click(function() { var textvalue = $( "#text-input").text(); alert('textvalue'); }); }); </script> But its not working at all. Can someone tell me how to do this?