jquery Get textarea input field's value on button clicking event?
jQuery is a Javascript framework.Using jQuery removes a lot of cross browser compatibility issues.
<script>
$(document).ready(function() {
//alert('test');
$('#total_grp_button').click(function() {
var text_area_val = $('#text_area').val();
alert(text_area_val);
jQuery('#text_area_val1').text(text_area_val);
});
});
</script>
<textarea id="text_area" class="new_text" name="text_area"></textarea>
<input type="button" name="submit" value="submit" id="total_grp_button">
jQuery is a Javascript framework.Using jQuery removes a lot of cross browser compatibility issues.
<script>
$(document).ready(function() {
//alert('test');
$('#total_grp_button').click(function() {
var text_area_val = $('#text_area').val();
alert(text_area_val);
jQuery('#text_area_val1').text(text_area_val);
});
});
</script>
<textarea id="text_area" class="new_text" name="text_area"></textarea>
<input type="button" name="submit" value="submit" id="total_grp_button">