开发者

Best control with image and onClick to call javascript function

What is the best control which can display image, call javascript and do it without postba开发者_运维知识库ck? maybe even change an image on hover?


You're looking for the <img> tag.


A HTML Element of your choice I suppose:

<div style="background: pink url(/image.png);" onclick="alert('javascript')">

</div>

CSS:

div:hover {
    background: lightgreen url(/image2.png);
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜