您好我有一個Java腳本中有一些文本的功能,但現在我想添加一個圖片。如何在javascript中添加圖片的功能
如何在函數內插入圖像?
這裏是JavaScript代碼:
<script type="text/javascript">
function CONshowElements(){
var Construction = "The construction company with several years of experience in projects valued over millions of USD having Service and Quality with satisfaction and appreciation of the clients";
document.getElementById("contents").innerHTML = Construction;
var image = new Image;
image.src = "images/SCALE Construction.png";
}
</script>
機身碼
<a href="construction.php"><div class="firstbox" id="Construction" onmouseover="CONshowElements(); return false; " >Construction</div></a>
[插入圖像對象到HTML(http://stackoverflow.com/questions/12287856/insert-image-object-into-html) – Cherniv 2014-09-30 05:03:08