Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
192
rated 0 times [  195] [ 3]  / answers: 1 / hits: 25495  / 13 Years ago, thu, december 8, 2011, 12:00:00

I want to display the line number in a textarea like this is possible in jQuery:



enter



I looked for answers on SO but I can't find what I want



Display current line and column number for a textarea



Limit number of lines in textarea and Display line count using jQuery



Also, the solution I tried from the JSFiddle provided from the comments show me the textarea like this:



enter



which line 1234 is the first line and the second line is 5678


More From » jquery

 Answers
57

Download the plugin found here: http://alan.blog-city.com/jquerylinedtextarea.htm



Usage:



$(function() {

// Target all classed with .lined
$(.lined).linedtextarea(
{selectedLine: 1}
);

// Target a single one
$(#mytextarea).linedtextarea();

});


Fully functional demo: http://files.aw20.net/jquery-linedtextarea/jquery-linedtextarea.html (web.archive)


[#88671] Wednesday, December 7, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
mollys

Total Points: 183
Total Questions: 95
Total Answers: 85

Location: Vanuatu
Member since Fri, May 13, 2022
2 Years ago
;