CSS Border for checkbox

manu picture manu · Jan 5, 2011 · Viewed 15.5k times · Source

I am applying a style for a checkbox from jQuery

$("#reg_checkbox").css("border","thin solid red");

The border works fine in IE but not in mozilla , how can I make it browser compatible ?

Answer

Eric Fortis picture Eric Fortis · Jan 5, 2011

Use Outline: http://jsfiddle.net/Kqcx7/1/

$('#reg_checkbox').css('outline-color', 'red');
$('#reg_checkbox').css('outline-style', 'solid');
$('#reg_checkbox').css('outline-width', 'thin');