Use jquery to add values to page element custom attributes, and get values: function Kmtypechange () {var typedesc= jQuery ("#kmtype"). Find ("option:selected"). attr ("desc"); JQuery ("#typeDesc"). html (typedesc? "). <%=propertiesutil.getproperty ("Process_add_select_desc")%> "+typedesc:"); JQuery ("#typeDesc"). attr ("title", Typedesc?) <%=propertiesutil.getproperty ("Process_add_select_desc")%> "+typedesc:");}
<select onchange= "Kmtypechange ();" Id= "Kmtype" name= "Kmtype" class= "textbox04" style= "Background-color: #eee;" > <option value= "" ><%=propertiesutil.getproperty ("Importworkbags_plesselwbstype")%></option > <c:foreach items= "${kmtypelist}" var= "Kmtype" ><option title= "${kmtype.typename}" desc= "${ KMTYPE.TYPEDESC} "value=" ${kmtype.id},${kmtype.typename} ">${kmtype.typeName}</option> </c:foreach ></select></td></tr><tr> <td><div style= "float:left;width:150px;" ></div><p id= "Typedesc" class= "TitleStyle" style= "Text-align:left"/></td></tr>