0

In Chrome when you click a JavaScript button, it will surround the button with a blue border and this indicates the user has clicked the button.

In Internet Explorer, this does not happen.

Is there any way to make the button border blue in IE?

I have tried below jQuery, but it doesn't work:

$("button").click( function () {
       $(this).css("outline", "solid");
});
  • This sounds like the Chrome bug mentioned in this blog post marcysutton.com/button-focus-hell - Chrome should not persist the focus style when you click on it. It's not related to JS buttons or Salesforce, it's just more obvious with JS buttons because you may not navigate away from the page when you click them. – shannonsans Jun 9 '17 at 17:00
0

Tested the below code in IE 11 and it works for me.Also if you are depending on browser agent to give you the style it may not be the right thing as each browser will behave in a different way,rather you give a CSS style explicitly

Markup :   <button>Hello</button>
$( document ).ready(function() {    
    $("button").click( function () {
     alert('Hello');
    $(this).css("border", "solid 1px blue");
    });
});

Also above code is just for illustration you should create a CSS class and associate that to the button element on click.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.