How To Show All Text Of Very Long Select Option? July 25, 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 Firefox, Chrome, Safari Have Grey Background For Mp4 Html5 Video Any video (that I can make) with a white background becomes… Red Border Still Appears On Inputs After Resetting An HTML 5 Form Firefox I have an HTML 5 form! Great, I'm excited! I decide to … Svg Animation And Firefox I'm struggle with SVG animation drawing, which is work … How To Save Html5 Geolocation Data To Python Django Admin? Is it possible to save the javascript html5 geolocation lat… How To Hide/show Tabs Using Jquery I have four tabs.On loading only the first tab is opened an… Form To Iframe Submission - How Do You Reset The Form After File Upload? I have a form that submits the results to an iframe. The su… How To Limit The Html Table Records In Each Page I am populating a table in my jsp which has more than 20 re… How To Display A Python String As Html In Jupyter Notebook In IPython notebook, I used to be able to display a python … How To Add Placeholder Field? I've been trying to add placeholder in input type='… Bounce Animation On A Scaled Object What is the best way to have an object scale and then perfo…