javascript - reset content in an Ionic ios/android application -
in html/css/js web application have js reset button so:
//reset button// document.forms[0].addeventlistener('reset', function() { document.getelementbyid('result').innerhtml = ''; document.getelementbyid('container').innerhtml = ''; document.getelementbyid('resultprem').innerhtml = ''; document.getelementbyid('containerprem').innerhtml = ''; });
i testing natively on android , ios using ionic , cordova , function doesn't work.
what correct way reset on ionic based applications? should using angular this?
im sorry if stupid or vague question, have searched similar questions.
any appreciated.
f
a simple example reset form in angularjs:
controller:
$scope.data = { "name": ""}; $scope.reset = function() { $scope.data.name = ""; }
html:
<form name="form" id="form" novalidate> <input name="name" ng-model="data.name" placeholder="name" required/> <button class="button" ng-click="reset()">reset</button> </form>
Comments
Post a Comment