删除图片,恢复图片 [英] Remove picture, Restore Picture

查看:116
本文介绍了删除图片,恢复图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个包含我的图片的网站,以及一个删除并恢复它的按钮。我有删除部分。现在我已经尝试开始修复部分。

I'm trying to make a website that has a picture of me, and a button that removes and restores it. I've got the removal part down. Now I've tried to start working on the restoration part.

我的第一个业务是在点击后更改按钮的文本。它最初说删除图片,但在点击它之后应该说恢复图片。但是这......只是行不通。图像消失但文本不会改变。谁能告诉我为什么会这样?

My first over of business was to change the text of the button after its clicked. It originally says "Remove Picture", but after its clicked its supposed to say "Restore Picture." But this...just doesn't work. The image disappears but the text does not change. Can anyone tell me why this is?

<button type="button"  OnClick="remove()" id="me_button">Remove Picture</button>
    <script type = "text/javascript">
        function remove(){
            document.getElementById("me").style.display = "none";

            //now we need a script that brings the picture back.

             document.getElementbyId("me_button").innerHTML = "Restore Picture";
        }



    </script>


推荐答案

有一个错字。

getElementbyId

是假设要

getElementById

这篇关于删除图片,恢复图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆