<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<div class="container">
<div class="row">
<div class="col-md-4">
<img src="https://cdn1.iconfinder.com/data/icons/softwaredemo/PNG/256x256/Pencil3.png" class="img-responsive center-block" alt="">
</div>
<div class="col-md-8">
<h3>
Writing text in < div > using forms, JavaScript and jQuery
</h3>
How to write to a HTML page without reloading and without using server side scripting.
<form name="frmComment" id="frmComment">
<label for="txtComment">Enter a comment here:</label>
<input type="text" name="commentUser" id="txtComment" class="form-control" placeholder="Enter a comment (html allowed)">
<br>
<button type="button" class="btn btn-success" value="Submit" onclick="writeComment()">Write out text</button>
<label><input type="checkbox" id="chkLorem" onclick="writeLorem()"> Use Lorem Ipsum text</label>
</form>
<hr>
<p>
Write to "textarea"
</p>
<textarea id="txtCommentHere" class="form-control" rows="3">
</textarea>
<p>
Write to <div>
</p>