Customizing input[type="range"] with CSS

Info from http://glazkov.com/2011/01/14/what-the-heck-is-shadow-dom/

by Trev Burley

HTML

<div class="rangeOutput">50%</div>
<input class="rangeSlider" type="range" min="0" max="100" />

CSS

input[type=range] {
    -webkit-appearance: none;
    background-color: #666;
    width: 90%;
    height:20px;
    margin: 30px auto;
    border-radius: 10px;
    display: block;
}

input:focus{
    outline: 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    background-color: #3c1940;
    opacity: 1;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid #fff;
}

.rangeOutput {
    width: 100%;
    text-align: center;
}
}

JavaScript

$(document).ready(function() {
    $('body').on('input', '.rangeSlider', function() {
        var sliderEl = $(this);
        $('.rangeOutput').html(sliderEl.val()+"%");        
    });
});