I would like simulate the event of clicking on an input element, typing a string and then pressing enter. The function I'm looking for should be given a string and write it to an html element. Does anyone know how I could do that? Here's the element: (the normal (second) element is what should be selected and written to)
<ion-input autocapitalize="off" autocomplete="off" autocorrect="off"
class="answerInput input input-md ng-valid ng-touched ng-dirty" id="answerInput"
name="answerInput" spellcheck="false" text-center="" type="text" ng-reflect-
name="answerInput"ng-reflect-model="" ng-reflect-type="text" ng-reflect-
autocomplete="off" ng-reflect-autocorrect="off"><!--bindings={
"ng-reflect-ng-if": "true"
}-->
<input class="text-input text-input-md" dir="auto" ng-reflect-klass="text-input"
ng-reflect-ng-class="text-input-md" type="text" aria-labelledby="lbl-1"
autocomplete="off" autocorrect="off" placeholder="" autocapitalize="off"
name="answerInput" spellcheck="false" text-center="" ng-reflect-
name="answerInput" ng-reflect-model="" ng-reflect-type="text" ng-reflect-
autocomplete="off" ng-reflect-autocorrect="off">
<!--bindings={
"ng-reflect-ng-if": "false"
}--><!--bindings={
"ng-reflect-ng-if": "false"
}--><!--bindings={
"ng-reflect-ng-if": "false"
}--></ion-input>
I already tried selecting it with:
var input = getElementByClassName('text-input text-input-md');
input.focus();
input.select();
It tells me select is not a function