we are using javascript/typescript and have been unable to pass the 'in-putted text' from a dxTextArea
in a DevExtreme (Typescript) Project.
We are using:
<div id="myTextArea" data-bind="dxTextArea: {showClearButton: true,value: 'MyTests'}" ></div>
<div data-bind="dxButton: { text: 'Save text' }" onclick="saveMyData(document.getElementById('myTextArea').innerText)"></div>
With the function "saveMyData" defined as:
<script>
function saveMyData(myData)
{
alert("text is "+myData.innerText);
mytext.innerText += myData.innerText;
}
</script>
However, the alert only contains
text is
We have also tried textContent
, but got the same results.
Anyone got an idea(s) of why this is happening?
there isn't an error on screen, so we don't think it's a declaration error.
(N.B. this code has been simplified for demonstration purposes).
Below is a link to the 'most helpful/detailed' docs:
Link to dxTextArea documentation
please feel free to ask for clarification/details as I know i'm pretty bad at explaining myself 'on paper'. I would post a fiddle only it doesn't/won't recognise the dxTextArea
nor dxButton
, so pretty useless!
EDIT
using innerHTML as suggested gives: