因为textarea中,所有的元素都是以文本的方式显示;
jsp 代码:
<textarea rows="3" cols="10" name="name" id="temp"> ${records} </textarea >
如在jsp中显示是:<span><font color='red'> xx </font></span>
后台java
s.indexOf(“xx”)!=-1&&m.indexOf(“xx”)!=-1) {
String color = “<font color=”+"‘red’"+">" + xx + “”;
String temp = s.replace(“xx”, color);
}
mv.addObject(“records”, temp);
想高亮某个字段显示不出来!
我个人方法是,将 textarea 替换成 div