<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> </head> <BODY> <p onClick="set('字体1');">字体1</p> <p onClick="set('字体2');">字体2</p> <p onClick="set('字体3');">字体3</p> <p onClick="set('字体4');">字体4</p> <p onClick="set('字体5');">字体5</p> <input id="shuru" type="text"/> <script> function set(name){ var input = document.getElementById("shuru"); input.value += name + ", "; } </script> </BODY> </html>