As per the above post you can insert text in div. For this you will need to ntegrate other functions such as changing the font to bold or italic. This gives a opportunityto use the function "execCommand" of JavaScript. So let's create a button for the format by calling the OnClick function. This function in turn increases the selected area and puts execCommand to the desired formatting. The sample type for the same is as follows.
PHP Code:
HTML>
<HEAD>
<style type="text/css">
# div (
height: 200px;
width: 100%;
border: 1px solid # 7d7d7d;
)
</ style>
<script language="javascript">
Format command function (, content) (
div.focus ();
document.execCommand (command, false, content);
)
</ script>
</ HEAD>
<BODY>
<button OnClick="formatting('bold','')"> Bold </ button>
<div id="div" contentEditable>
</ div>
</ BODY>
</ HTML>
Bookmarks