how to leave a select option by default

-1

Hello, I need to show an option of the select already selected, I want it to show selected the option of Select salary

This is the code that I have but still does not show me anything selected, it shows me the empty selection

select#selectsueldoedit.form-control(style='border: 1px solid #ccc;border-radius: 4px;padding: 6px 12px;height: 34px;line-height: 1.42857143;font-size: 14px;color: ')
          option(value='Seleccione sueldo', selected='selected') Seleccione sueldo
          each sueldo in datos.sueldos
             option(value=''+sueldo.pk) #{sueldo.sueldo}
    
asked by Karime 20.08.2018 в 03:10
source

1 answer

1

<select id="sueldo">
  <option>1</option>
  <option>2</option>
  <option selected="selected">3</option>
  <option>4</option>
  <option>5</option>
</select>

To the option you want to appear "default" you must place the attribute selected="selected" . If you are using another programming language, you could indicate which one

    
answered by 20.08.2018 в 03:20