How to clear text input a page onload?

Hi guys , I want to clear text input on a page
In Category.html

<ion-view view-title="Category">
<ion-content>
<div>
<input type="text" id="txtsearch" placeholder="Search"  >
</div>
</ion-content>    
</ion-view>

Ok , when i type some character in input text , example “ABC”, then click tabs other, then click tab Category , text in input auto clear.I try set $ionicView.loaded in controller , but it’s not work.

.controller('CategoryCtrl', function ($scope) {
$scope.$on('$ionicView.loaded', function (e) {
document.getElementById("txtsearch").value = "";
});
})

Thank you.

if you’re using tabs then i’d do the following

<ion-tab on-select="doThisFunction()">....

In Controller

$scope.doThisFunction = function(){
    document.getElementById("txtsearch").value = "";
};

Well , thank you so much.