i am using asp.net core 2 to create a form, i want to count the number of characters left when the user is typing but its not working, so on the view i have tried this
<div id="counter" class="error"></div>
@Html.TextArea("Text2", new { @id = "Text2" })
and this
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="~/Scripts/MaxLength.min.js"></script>
<script type="text/javascript">
$(function () {
//Specifying the Character Count control explicitly.
$("#Text2").MaxLength(
{
MaxLength: 15,
CharacterCountControl: $('#counter')
});
});
});