I have a strange behavior in my browser with an input field. When I inspect it in developer console it looks like this:
<input type="text" name="siteName" ng-model="model.name" minlength="3"
maxlength="40" ng-disabled="!model.isEditable || disableUpdate"
required=""
class="ng-pristine ng-untouched ng-empty ng-valid-namevalidation ng-invalid ng-invalid-required ng-valid-minlength ng-valid-maxlength">
After the page is rendered, in chrome developer console, I select this input field like this:
var x = document.querySelector('input[name="siteName"]')
and I get it in console.
This input field has a value in UI (a string, not empty) - is filled by angularjs in this way: ng-model="model.name". model.name
has a valid string value.
when I call x.value
in console, I get an empty string.
More, in chrome developer console, when inspect an element, I can access it using $0. And $0.value returns me the correct value.
Anyone had such issue? Any idea how to get using query selector the value for the input field?
Thank you.