<form id="form1" name="form1" method="post" action=""> <p>请输入图片地址 <input type="text" name="a" id="a" /> <input type="button" name="button" id="button" value="输入" onclick="g()"> </p> <p> <textarea name="b" id="b" cols="45" rows="5"></textarea></p></form>
<script language="javascript"> function g() { var str = document.getElementById('a').value str="<img>"+str+"</img>" document.getElementById('b').value=str }</script>