My HTML page code looks like this-
<div id="test-inputEl" role="textbox" class="test-field" data-errorqtip="">10</div>
To access this value 10
I am using below code-
var divObject = parent.document.getElementById('test-inputEl');
alert(divObject);
var testField = divObject.getElementsByClassName("test-field");
alert(testField);
For the first alert
box I'm getting-
[object HTMLDivElement]
and for the second one I'm getting-
[object HTMLCollection]
But I can't access the value. I have tried like this-
var objValue = divObject.getElementsByClassName("x-form-display-field")[0].innerHTML;
But not Working.
Is there any way to get this value or set this value using javascript
. Because I'm not much familiar with jquery
.