Search
 
SCRIPT & CODE EXAMPLE
 

HTML

drop down onchange javascript

 <select id="ddlFruits">
    <option value=""></option>
    <option value="1">Apple</option>
    <option value="2">Mango</option>
    <option value="3">Orange</option>
</select>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
    $(function () {
        $("#ddlFruits").change(function () {
            var selectedText = $(this).find("option:selected").text();
            var selectedValue = $(this).val();
            alert("Selected Text: " + selectedText + " Value: " + selectedValue);
        });
    });
</script>
Comment

PREVIOUS NEXT
Code Example
Html :: libcuinj64-9.1 : Depends: libcuda1 (= 387.26) 
Html :: chrome full screen mac hide tabs 
Html :: dutch phone pattern html 
Html :: html form select 
Html :: default date in html 
Html :: external js 
Html :: handlebars js cdn 
Html :: discernible name 
Html :: how to put an image in the top right corner html 
Html :: input checkbox 
Html :: md bootstrap cdn 
Html :: radio buttons html 
Html :: get input value on button click javascript 
Html :: boostrap 4 clear input 
Html :: clear html screen 
Html :: restart remote computer cmd using ip address 
Html :: timestamp trigger is not defined 
Html :: HTML Table Padding & Spacing 
Html :: button to return to previous page html 
Html :: ionic 4 bind html 
Html :: font awesome show password icon 
Html :: What is the browser default background color for selected text 
Html :: Send a SMS Text From A Link - the new code 
Html :: add link behind a button in html 
Html :: how to add multiple CSS inline html 
Html :: how to align image with text in html 
Html :: pyscript boilerplate 
Html :: call to action phone number 
Html :: change icon html 
Html :: htmml 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =