Display Drop Down Selected Option In Php January 28, 2024 Post a Comment I want to display a simple html drop down box and selected value want to print. FlipkartSolution 1: Use jQuery$(document).ready(function(){ $(".showDescriptionTextbox").val($(".Product").val());//to initialize $(".showDescriptionDiv").text($(".Product").val());//to initialize $(".Product").change(function(){ $(".showDescriptionTextbox").val($(".Product").val()); $(".showDescriptionDiv").text($(".Product").val()); }); });Copy<scriptsrc="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><selectname="v"class="Product"id="dropdown"><optionvalue="fkt">Flipkart</option><optionvalue="snd">Snapdeal</option></select><br/><br/> value in textarea: <inputtype="text"class="showDescriptionTextbox"><div> or you can display value in div: <spanclass="showDescriptionDiv"></span></div>CopySolution 2: <selectname="v"class='Product'><optionvalue="fkt">Flipkart</option><optionvalue="snd">Snapdeal</option></select><textareaclass='showDescription'></textarea><br><scriptsrc="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script><script> $(function(){ $('.Product').change(function(){ varProduct = $('.Product').val(); $(".showDescription").val(Product); }); }); </script>CopySolution 3: Check for it.functionshop(shop) { $("#show").val(shop); } Copy<scriptsrc="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script><selectonchange="shop(this.value)"><optionvalue="Flipkart">Flipkart</option><optionvalue="Snapdeal">Snapdeal</option></select><br/><br/><inputtype="text"id='show'>Copy Share Post a Comment for "Display Drop Down Selected Option In Php" Top Question December 2024 (1) November 2024 (40) October 2024 (59) September 2024 (20) August 2024 (362) July 2024 (338) June 2024 (685) May 2024 (1285) April 2024 (776) March 2024 (1534) February 2024 (1715) January 2024 (1344) December 2023 (1408) November 2023 (439) October 2023 (703) September 2023 (310) August 2023 (330) July 2023 (275) June 2023 (344) May 2023 (212) April 2023 (138) March 2023 (136) February 2023 (170) January 2023 (270) December 2022 (124) November 2022 (231) October 2022 (176) September 2022 (163) August 2022 (290) July 2022 (93) Menu Halaman Statis Beranda © 2022 - Html5 Tutorial