【发布时间】:2021-05-31 14:52:37
【问题描述】:
<script type="text/javascript">
//this will make it appear
function showPicture() {
var sourceOfPicture = "img/tierlist.jpg";
var img = document.getElementById('tierlist')
img.src = sourceOfPicture.replace('90x90', '225x225');
img.style.display = "block";
}
// this will remove the picture
function removePicture() {
var image_x = document.getElementById('tierlist');
image_x.parentNode.removeChild(image_x);
img.style.display = "block";
}
</script>
我希望它有无限的点击次数,而不仅仅是一个完成的按钮,我该怎么做?
【问题讨论】:
-
也许它停止工作是因为你的整个脚本崩溃了。控制台有错误吗?
-
您需要向我们展示您的 HTML 或您调用函数的位置。
标签: javascript html css web