您可以使用Javascript DOMAPI。特别是,请查看createElement()方法。
您可以创建一个可重复使用的函数,以创建一个像这样的图像…
function show_image(src, width, height, alt) { var img = document.createElement("img"); img.src = src; img.width = width; img.height = height; img.alt = alt; // This next line will just add it to the <body> tag document.body.appendChild(img);}然后您可以像这样使用它…
<button onclick= "show_image('http://google.com/images/logo.gif', 276, 110, 'Google Logo');">Add Google Logo</button>


