Skip to content
Advertisement

Change checkbox tickmark color

I’ve implemented a function to change the background color of my checkbox , but it makes the tickmark turns to color black which I don’t want , I want the mark to still white , how can I achieve this ?

HTML :-

JavaScript

here’s the function :-

JavaScript

and here’s the output :- enter image description here the background changed successfully but the tickmark changed to color black

Advertisement

Answer

The tickmark color for the default HTML checkbox is decided by the browser and cannot be changed. You can however create your own custom checkbox and style it however you want.

HTML

JavaScript

CSS

JavaScript

JSFiddle

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement