- 1). Create a JSP page in the IDE. Here is an example:
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html><head></head><body></body> </html>. - 2). Add a form to the JSP page:
<form method="POST"> </form>. - 3). Use the "select" tag with "multiple" attribute and add a list to the form:
<select name="colorList" multiple>
</select>. - 4). Use the "option" tag with "style" attribute to add colored choices to the list:
<select name="colorList" multiple>
<option value="red" style="color:red;"> Red </option>
<option value="blue" style="color:blue;"> Blue </option>
<option value="black" style="color:black;"> Black </option>
</select>.
next post