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

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -