Skip to content

masum/caretcoord

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

<html>
<script src="jquery-1.3.2.min.js"></script>
<script src="jquery.caretcoord.js"></script>
<script>
$(document).bind("ready",function() {
  $("#tfield").click(function() {
    var pos = $(this).getCaretCoord();
    console.log(pos);
  });
  $("#ifield").click(function() {
    var pos = $(this).getCaretCoord();
    console.log(pos);
  });
});
</script>
<body>
<textarea id="tfield"> abced</textarea>
<input type="text" value="abcdef" id="ifield"/>
</body>
</html>

or 

<script src="caretcoord.js"></script>
<script>
$(document).bind("ready",function() {
  var elm1 = document.getElementById("ifield");
  var caret1 = new caretcoord(elm1);
  $("#ifield").click(function() {
    var pos = caret1.getCaretCoord();
    console.log(pos);
  });
});
</script>
<body>
<input type="text" value="abcdef" id="ifield"/>
</body>

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published