How To Show All Text Of Very Long Select Option? February 26, 2024 Post a Comment I have some very long s in a box but I don't want the box to be so wide. The problem is that the full text can't be read when I style the box smaller.Solution 1: what about this? <select id="muchtextselect"> <option value="" title="This is some long text text This is some long text text This is some long text text ">This is some longtexttext This is some longtexttext This is some longtexttext </option> <option value="">ShortText</option> <option value="" title="This is some really, really long text">This is some really, really longtext</option> </select> Copyjsvar maxLength = 15; $('#muchtextselect > option').text(function(i, c) { if (c.length > maxLength) { return c.substr(0, maxLength) + '...'; } }); CopyWORKING DEMOSolution 2: USE style="width:xx%;"Example<select name="data" style="width:50%;"> <option value="1">Lorem Ipsum</option> <option value="3">simply dummy</option> <option value="3">textof the printing and typesetting industry. Lorem Ipsum has been the industry's</option> </select> CopySolution 3: Please use Select2 last version with bootstrap :) i found it in 2 days https://select2.org/{!! Html::style('backend/dist/css/select2.min.css') !!} {!! Html::style('backend/dist/css/select2-bootstrap.css') !!} {!! Html::script('backend/dist/js/select2.min.js') !!} CopySolution 4: You can use max-width + text-emphasis css properties. For more information you can check here:http://www.w3schools.com/cssref/pr_dim_max-width.asphttp://www.w3schools.com/cssref/css3_pr_text-emphasis.asp Share Post a Comment for "How To Show All Text Of Very Long Select Option?" Top Question Right Floated Element Disappears When Using Columns In Firefox I am using an ol element with column-count and column-gap p… How To Resize Parent By Dragging One Of It's Children? Essentially i want to resize the green box by dragging the … How Do I Pass A Value In A Input Box, To Another Input Box I am trying to pass values between boxes. So, When a User … How Does An OS Pick Up The Correct Ico/favicon Size? Based on this stackoverflow discussion, one can provide var… How To Find Absolute Or Relative Position Of Text Or In HTML? I was wondering if there is a way I could find the position… JQuery Show Submenu If Parent Have Been Clicked Could some one please help with code. I want to show the su… What Is The Correct Way For Redirecting From The Domain Name Itself To A Page In A Directory? I want anyone browsing for 'MyDomain.com' to see wh… Html Formatted Text In An Email In Java try{ String msg='Happy BirthDay Dear, '+na… Material Design Icon Isn't Working On Ie 11 I'm using MaterialDesign icons on my application, howev… R: Output A Pivot-like Table With Subtotals I'm trying to make a cross tabulation in R, and having … December 2024 (1) November 2024 (37) October 2024 (58) September 2024 (17) August 2024 (370) July 2024 (337) June 2024 (695) May 2024 (1294) April 2024 (826) March 2024 (1551) February 2024 (1690) January 2024 (1348) December 2023 (1319) November 2023 (287) October 2023 (569) September 2023 (333) August 2023 (342) July 2023 (279) June 2023 (379) May 2023 (202) April 2023 (144) March 2023 (133) February 2023 (166) January 2023 (257) December 2022 (139) November 2022 (205) October 2022 (175) September 2022 (157) August 2022 (295) July 2022 (96) Menu Halaman Statis Beranda © 2022 - Html5 News