【发布时间】:2014-09-30 13:03:09
【问题描述】:
您好,我在 java 脚本中有一个函数,其中包含一些文本,但现在我也想添加图像。
如何在函数内插入图片?
这是 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>
【问题讨论】:
标签: javascript