- 1). Open the HTML code controlling the page with the drop-down box.
- 2). Go to the drop-down box section of the body section. The Javascript function definition itself (in head) can be left as is.
- 3). Encase the line you want to wrap in “div” brackets. If the text is “XYZ,” it would become “<div>XYZ</div>”. This defines it as a separate Javascript element within the HTML, letting you modify it independently.
- 4). Type “<br/>” where you want the wrap break to appear. For instance, if you wanted to “Z” on a second line, it would now be “<div>XY<br/>Z</div>”.
- 5). Save the code. When you refresh the page, the text in the drop-down box will be wrapped.
SHARE