Remove first option from a selectbox

by dcardoso

HTML

<select>
    <option data-placeholder="true">Seleccionar Conta</option>
    <option>123</option>
    <option>456</option>
</select>

JavaScript

$('select').change(function () {

    if ($("select option:selected").attr('data-placeholder') != 'true' && $("select option:first").attr('data-placeholder') == 'true') {
        $(this).children(':first').hide();
    }

});