Home>
Moving sample
. txt-area {
outline: none;
user-select: text;
white-space: pre-wrap;
overflow-wrap: break-word;
background: lightgray;
line-height: 30px;
font-size: 20px;
max-height: 90px;
width: 400px;
border: 2px solid;
border-color: # 1da1f2;
overflow-y: scroll
}
var tBox = document.getElementById ("dmComposerTextInput");
tBox.addEventListener ('input', function () {
if (tBox.innerText.length>3) {
// TODO: There is no effect on the operation, but it is an error, so it needs to be corrected when there is time.
tBox.prop ("contenteditable", false);
}
});
Troubleshooting
When you start typing text, an error like the title is displayed.
I'm having trouble understanding the cause.
There is no effect on the intended operation, but I think that an error has occurred for some reason, so I want to do something.
-
Answer # 1
Related articles
- javascript "uncaught typeerror: cannot read property'property name'of undefined" error meaning
- javascript file api "uncaught typeerror: cannot read property'slice' of undefined" error
- javascript - uncaught typeerror: 〇 〇 i want to solve is not a function
- javascript - uncaught (in promise) typeerror: cannot read property'id' of undefined in vuex
- jquery - uncaught typeerror: is not a function cannot be resolved
- javascript - uncaught error: unknown format: i don't know how to resolve [object htmlheadingelement]
- html5 - uncaught typeerror: documentgetelementbyid is not a function at : 1 i don't understand the content of the error message
- javascript - uncaught syntaxerror: invalid left-hand side in for-loop in js
- i don't understand the error statement "uncaught syntaxerror: unexpected end of input" in html javascript embedding
- javascript - uncaught syntaxerror: unexpected token''
- javascript - react django typeerror: cannot read property'map' of null error
- javascript - uncaught reference error in js: $is not defined error
- javascript - uncaught referenceerror: category is not defined
- uncaught error: cannot find module javascript error
- javascript - i am not sure how to resolve uncaught syntaxerror: unexpected token <in json at position 0
- html - i don't know how to resolve uncaught typeerror: cannot read property'length' of undefined
Related questions
- javascript : Changing the color of an li in a specific ul
- javascript : Prop doesn't work on checkbox
- javascript : Ellipsis instead of spaces
- javascript : Disabled option
- javascript : JS change body mask input
- javascript : How to make the active center slide in Owl Carousel 2 larger than the rest
- How to rollback an element in javascript
- javascript : Line break in code
- javascript : JS Comparing id and displaying a suitable image
- javascript : Removing the content of an element with a specific id
Are you mistaken for jQuery?
【. prop () | jQuery API Documentation】
https://api.jquery.com/prop/
[HTMLElement.contentEditable-Web API | MDN]
https://developer.mozilla.org/en/docs/Web/API/HTMLElement/contentEditable