我想要一個圖片加載onclick到一個警告框,但我得到 "[object HTMLImageElement]"
圖片應該在哪裏。是否可以在警告框中加載圖片?
這是我有:
function joePic(){
var joe_fat = new Image;
joe_fat.src = "pic1.jpg";
alert (joe_fat);
}
<input type="button" value="Click here it find out" name="joePhoto" onclick="joePic()"
height="150" width="150" />
這可能嗎?
這東西的原因是:https://developer.mozilla.org/en/window.alert –
http://jqueryui.com/demos/dialog /如果您正在尋找警報的替代方法,則會提供很好的,有主題的對話框。 – grc