1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>using jQuery Word Count Plugin</title>
<script type="text/javascript" src="http://js.nicedit.com/nicEdit-latest.js"></script>
<script type="text/javascript">
bkLib.onDomLoaded(function() { new nicEditor().panelInstance('content-text-ta'); });
</script>
<style type="text/css">
<script type="text/javascript" src="...jquery.js"></script>
<script type="text/javascript" src="...jquery.wordcount.js"></script>
<script type="text/javascript">
<!--//---------------------------------+
// Developed by Roshan Bhattarai
// Visit http://roshanbh.com.np for this script and more.
// This notice MUST stay intact for legal use
// --------------------------------->
$(document).ready(function()
{
$('#cosntent-text-ta').wordCount();
//alternatively you can use the below method to display count in element with id word_counter
//$('#word_count').wordCount({counterElement:"word_counter"});
});
</script>
body {
font: 12px Verdana,Arial, Helvetica, sans-serif;
margin: 10px auto;
width:350px;
}
</style>
</head>
<body>
<h2>jQuery Word Count Plugin Demo</h2>
<div id="container">
<div>
<p><br />
<textarea name="word_cou" id="content-text-ta" cols="30" rows="6"></textarea>
</p>
<p> <span style="color:#FF0000">Total word Count : <span id="display_count">0</span></span>
</p>
</div>
</div>
</body>
</html> |
Partager