您的位置:首页 > Web前端 > AngularJS

Angularjs input输入框值,被选中

2018-01-18 11:21 495 查看
/** --------------指令 按下回车事件,单击事件 ”选中“输入框的值-----------*/
module.directive('selectline', function () {
return {
restrict: 'A',
link: function (scope, element, attrs) {
//element.bind('mouseover',function(event){//鼠标滑到数据时,选中
//        this.select();
//});
element.bind('click',function(event){//点击时,选中
this.select();
});
element.bind('focus',function(event){//获取焦点时,选中
this.select();
});
}
};
});
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Angularjs