I went through the following link for displaying line numbers in the textarea
in my ReactJS component.
Html adding line numbers to textarea
There is a perfect solution in this line whose link is this.
This link is working well in the demo, but when I use it in my ReactJS code, It doesn't work. Following is the way in which I'm implementing this
Index.html:
In this file, I'm importing my JS files in this way:
<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" />
<script>
$(function() {
$(".lined").linedtextarea(
{selectedLine: 1}
);
});
</script>
EditorModal.js:
Then in this file, I'm using textarea
as:
<textarea class="lined" id="lined" rows="10" cols="60">JavaScript was originally developed by Brendan
Eich of Netscape under the name Mocha,
which was later renamed to LiveScript,
and finally to JavaScript.
</textarea>
After doing this, I'm seeing any line number in textarea. How can I use thorse JS files with my textarea
tag?