【问题标题】:How to show the position of highlighted text in a textarea and editable div, in a another textarea?如何在另一个文本区域中显示文本区域和可编辑 div 中突出显示的文本的位置?
【发布时间】:2021-04-22 12:43:57
【问题描述】:

有人可以帮助修改以下代码以从按钮作为简单的 js 函数运行,并显示突出显示的文本及其在另一个文本区域中的位置吗?我尝试使用出现在 console.log 中的变量。但它没有用。 the source of the code

https://stackoverflow.com/questions/60359921/how-to-get-highlighted-text-position-from-textarea

【问题讨论】:

  • 您尝试了哪些方法,问题出在哪里?

标签: javascript textarea


【解决方案1】:

我只是尝试重用该变量,但没有奏效。 document.getElementById("n3").value = startPos;

【讨论】:

猜你喜欢
  • 2010-09-13
  • 2019-05-26
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-01-06
  • 1970-01-01
相关资源
最近更新 更多