Languages

Menu
Sites
Language
[Gear] Tags with onclick are highlighted with orange

Hi!

I have:

    <div id="my_button" onclick="clickDoSomething()"></div>

When clicking it has "not nice" orange highlighting.

Can't get rid of this! 

Please help. Thanks.

 

Edited by: Serhii Kolomiiets on 01 Jul, 2014

Responses

4 Replies
Marco Buettner

DIV elements are native not clickable... You have to setup an eventlistener

var my_button = document.querySelector('#my_button");
my_button.addEventListener('click', function() {
    this.style.background = "orange";
});

 

AVSukhov

Hello,

You may use following pseudo-class:

element::selection
AVSukhov

Hello,

You may use following pseudo-class:

element::selection

Serhii Kolomiiets

Thanks for helping.

But I found another elegant solution:

* {

    -webkit-tap-highlight-color: rgba(0,0,0,0);
    -webkit-tap-highlight-color: transparent;  

}

 

:)