Javascript 当用户点击';x';图标输入字段?

Javascript 当用户点击';x';图标输入字段?,javascript,html,angularjs,Javascript,Html,Angularjs,我为输入字段设置了一个字符计数器,它能正常工作,这是我在使用IE浏览器和用户使用“x”图标清除字段时看到的唯一问题,它没有将工具提示值设置回maxLength。在使用IE“x”清除字段时,如何触发事件,是否有任何解决方法 main.html <div class="col-md-3"> <input type="text" class="form-control" ng-model="input.searchValue" placeholder="Ent

我为输入字段设置了一个字符计数器,它能正常工作,这是我在使用IE浏览器和用户使用“x”图标清除字段时看到的唯一问题,它没有将工具提示值设置回maxLength。在使用IE“x”清除字段时,如何触发事件,是否有任何解决方法

main.html

<div class="col-md-3">
    <input type="text" class="form-control"
        ng-model="input.searchValue" placeholder="Enter search item"
        maxlength="256" name={{$index}}
        data-tooltip-html-unsafe="
        <div>{{256 - input.searchValue.length}} characters left</div>"
        tooltip-trigger="{{{true: 'focus', false: 'never'}[ input.searchValue.length >= 0 || input.searchValue.length == null ]}}"
        tooltip-placement="top" tooltip-class = "bluefill"/>
</div>


您可能能够利用mouseup事件,如下所示:感谢我使用Angular ng mouseup的帮助,它确实起了作用。再次感谢