js 点击两张图片来回切换
<script>
function change_pic() {
var imgObj = document.getElementById("caocao_pic");
if (imgObj.getAttribute("src", 2) == "../img/jpg/1.png") {
imgObj.src = "img/jpg/2.png";
} else {
imgObj.src = "../img/jpg/1.png";
}
}
</script>
<img
src="../img/jpg/1.png"
class="wujiang_pic_size"
id="caocao_pic"
onClick="change_pic()"
/>