Learn free online HTML5, javascript, and jquery Tutorials by Examples

Thursday, 12 June 2014

jquery-delete-multiple-values-options-listbox

-----------------------------------------------------
<script src="http://http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>  
<div class="one">
    <select>
        <option>1</option>
        <option>2</option>
        <option>3</option>
        <option>4</option>
    </select>
    <input type="button" value="delete" id="rem" />
</div>  

<script>
    $(document).ready(function(e) {
        $('#rem').click(function(e) {
             $('.one').find('option:selected').remove();
        });
     
    });
</script>

----------------------------------------------------

No comments:

Post a Comment