Check if certain row in textarea is empty
How to check if certain r开发者_运维问答ow in textarea is empty?
document.getElementById('textareaID').value.length === 0
I know what you're saying, but I've honestly never seen anything like it. You'd need to first be able to find all the rows in a textarea. With the textarea being an HTML element and the rows in it are not, I don't believe this can easily be done. You'd have to somehow append tags around each set of characters that are from start to end and then count those.
So basically you're looking at:
- Count the number characters
- Determine the absolute width of the textarea
- check to see how many characters it takes to reach the full width of the textarea without wrapping to the next line.
- Look through all of this and append tags around each set of row character blocks with a specific class and then do a count on those classes.
I'm not a JavaScript Guru and I have not written any books, but I've done a lot of JavaScript and jQuery work and from my experience, you would this to be a very troublesome project and may not even be possible to work the way you want it.
Sorry I couldn't help anymore.
What exactly are you trying to accomplish?
精彩评论