angularjs - How to add focus on the cancel label of the popup? -
i have popup function. has template pop up. has 1 delete , cancel button. want have focus on cancel button when popup opens. how can that?
$scope.popup = function(funcname){ alert_template({ id: '', title: '', scope: $scope, template: '<div class=""><span>delete selected item?</span></div>', success: { label: 'delete', fn: function(){ //do } }, cancel: { label: 'cancel', fn: //do } });
versions of js differ may or not need # identify object.
javascript:
document.getelementbyid('cancel').focus();
jquery:
$('#cancel').focus();
Comments
Post a Comment