I am using some JavaScript within an angular project (I am not familiar with angular.js, hence Js). I have a text input field in my form with a placeholder by default. I want to insert some actual text into the field depending on user action.
HTML:
<input type="text" id="logon" name="logon" ng-model="user.logon" placeholder= "Username" required>
When I run
var x = document.getElementById("logon");
x.value = "a";
nothing happens. Yet, when I use
var x = document.getElementById("logon");
x.placeholder = "b";
the place-holder text is changed, This would surely indicate that the code is running at the correct time, just that I'm missing something in the x.value
code line?