this is my code ,i fill space all in div ,(use jquery):
<div id="a" style="position:absolute;top:300px;width:100px;height:100px;background:red;color:black;word-wrap:break-word;">
<div id='a2' contenteditable=true ></div>
</div>
<script type="text/javascript">
String.prototype.repeat = function(n) {
return new Array(1 + parseInt(n, 10)).join(this);
}
var s=$('#a').width()/4*$('#a').height()/19;
$('#a2').html(' '.repeat($('#a').width()/4*parseInt($('#a').height()/19)))
$('#a2').click(function(){
alert('sss')
})
</script>
so how can i get the text cursor position when i click somewhere in 'a2' div
the demo is http://jsfiddle.net/KBnKc/
thanks