日期:2014-05-16 浏览次数:20421 次
<html> <script> function set(){ var s; var a=1; var b='aaa'; s="<input type='button' onclick='add("+a+",\""+b+"\",2)' value='click' />"; document.getElementById("content").innerHTML=s; } function add(id,name,num){ alert(id); } </script> <body> <input type="button" value="touch" onclick="set()" /> <div id="content"></div> </body> </html>