Search
 
SCRIPT & CODE EXAMPLE
 

HTML

select placeholder

// A non-CSS - no JavaScript/jQuery answer: 
// add option and disable it, it will act like placeholder.  
<select>
    <option value="" disabled selected>Select your option</option>
    <option value="optionA">optionA</option>
</select>
Comment

select add placeholder

//The Javascript
$('select').select2({
    minimumResultsForSearch: -1,
    placeholder: function(){
        $(this).data('placeholder');
    }
});
//Add this in HTML
<select data-placeholder="Your Placeholder" multiple>
    <option></option> 
    <option>Value 1</option>
    <option>Value 2</option>
    <option>Value 3</option>
    <option>Value 4</option>
    <option>Value 5</option>
</select>
Comment

PREVIOUS NEXT
Code Example
Html :: to centre each content in html 
Html :: firefox image/svg+xml not working 
Html :: how to put icons in select 
Html :: button display text html 
Html :: ejs ternary 
Html :: add jquery script in html 
Html :: html prevent focus on input 
Html :: Align an element to bottom with flexbox 
Html :: word inhoudsopgave 
Html :: html arrow symbol 
Html :: html shortcuts 
Html :: html download file from server to client 
Html :: html mouse over text 
Html :: bootstrap cdn 
Html :: svg img tag not showing 
Html :: how to shift div to right 
Html :: bootstrap 4 form input group 
Html :: center class in html 
Html :: tailwind nth child odd even 
Html :: <i class="fa fa-tag"</i fontawesome 
Html :: alt html 
Html :: run another Html in html 
Html :: a tag onclick 
Html :: html entity for degree celsius 
Html :: html form detached submit button 
Html :: select default value 
Html :: how to keep :active css style after click a button 
Html :: how to make a div responsive in css 
Html :: Chrome Extension change popup 
Html :: ngbdatepicker disable input 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =