javascript - How to create auto-input script based on agularJS? -


i´m trying implement greaskemonkey script make auto-input, cannot find way it.

what have: html form:

<form ng-submit="buy(quantity2)">         <input name="quantity" type="text" ng-model="my.quantity" style="width:30px" maxlength="2">     </form> 

i don´t know how input value box, do

$("input[name='quantity']:first").val("1"); 

unfortunately val doesn´t exists here. need help, thanks!

for better understand give example how can take value.

html form:
 <form ng-submit="buy(youravlue)">       <input name="quantity" id="quantity" type="text" ng-model="youravlue" style="width:30px" maxlength="2"> </form> 

using ng-submit can take value way.

 $scope.buy=function(data){     console.log(data);  } 

using id can take value way.

angular.element("#quantity").val(); 

Comments