阅读背景:

追加文本字段并使用jquery使其自动完成

来源:互联网 

app.js

$scope.add = function () {
  $('#btn').click(function() {
  // insert a SPAN tag with class="spn" at the end in all DIVs with      class="cls"
     $scope.data=[];
     var add=' <input type="text" name="currency" id="autocomplete">' ;
     $('div.cls').append(add);
     i++;
     $scope.count++;
  });
}

$scope.autocomplete=function(){
  var currencies = [
    { value: 'Afghan afghani' },
    { value: 'Albanian lek'},
    { value: 'Algerian dinar'},
    { value: 'European euro' }
  ];

  // setup autocomplete function pulling from currencies[] array
  $('#autocomplete').autocomplete({
    lookup: currencies,
  });
}
$scope.add = function () {
  $('#btn'



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: