Line Number Textarea Using jQuery

Line Number Textarea Using jQuery

How to create line number on textarea using jquery

Line-Number-Textarea-Using-jQuery2

Import Library

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script src="jquery-linedtextarea.js"></script>
<link href="jquery-linedtextarea.css" type="text/css" rel="stylesheet" />

Use Script

$(function() {
  // Target all classed with ".lined"
  $(".lined").linedtextarea(
    {selectedLine: 1}
  );
  // Target a single one
  	$("#mytextarea").linedtextarea();
});

Make Content

<textarea class="lined" rows="20" cols="60">
your text on textarea
</textarea>

 

Tags: ,