javascript - How to Sense case and writing in HTML input
问题描述
I want to write a question and options in a text box in the format of a Word file, for example, or text. When I save, I want to bring the question to the table of questions and options to its table. How do I read the text document or the text inside the input line with a line of feeling that the line represents a question or options, for example:
*#Question 1
*Options
*Options
*Options*
What is here is how the lines can be listed and their ability to sort by line after line or by word after word.
解决方案
我认为您要问的是如何访问 html 中的元素。为此,您需要 DOM。元素是您要获取的文本的 id
var element_text = document.getElementById("element").innerHTML
推荐阅读
- azure-devops - 在 Azure DevOps 中,如何将工作项从外部项目/组织链接到本地项目中的分支?
- python - 如何调整 Matplotlib 和 Seaborn 图形的间距?
- c++ - 使用_stat获取文件创建时间链接失败
- python - 将 numpy 3-d 数组拆分为较小 3-d 数组的 2-d 数组
- c - #define 预处理器指令值
- c - `"
" 想使用 VS Code 和 macOS Catalina 访问 Documents 文件夹中的文件 - reactjs - 有没有办法使用样式组件/ JSX 作为标记元素?
- c# - Blazor 浏览历史记录和页面引荐来源网址
- google-apps-script - 将特定范围的单元格导出为 PDF - Google 表格
- javascript - 无法读取 d3.js 的未定义属性“序数”