Я пытаюсь проверить, используя (JQuery) текстовую область, которую я заменил ckeditor, кажется, что она не может взять мою текстовую область.
here<div class="form-group">
@Html.Label("Instructions", htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.TextArea("Instruction", new { @class = "form-control question-textarea", @style = "height:100px", @placeholder = "Enter instructions here" })
Instructions: <span id="linesUsed">0</span> of 15
</div>
</div>
Мои JavaScript и Jquery
enter code here <script>
CKEDITOR.replace("Instruction");
</script>
<script>
$(document).ready(function () {
var lines = 15;
var linesUsed = $('#linesUsed');
$('#cke_1_contents').keydown(function (e) {
newLines = $(this).val().split("</p>").length;
linesUsed.text(newLines);
if (e.keyCode == 13 && newLines >= lines) {
linesUsed.css('color', 'red');
return false;
}
else {
linesUsed.css('color', '');
}
});
});
</script>
кажется, что мой Jquery не берет идентификатор для моей текстовой области, кто-нибудь знает, как мне получить идентификатор текстовой области в ckeditor.