Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用HTML按钮更改容器?_Html_Button - Fatal编程技术网

如何使用HTML按钮更改容器?

如何使用HTML按钮更改容器?,html,button,Html,Button,所以我有这个代码: <body bgcolor="#FFF"> <table class="body-wrap"> <tr> <td class="container"> <div class="content"> <div id="logo"> &

所以我有这个代码:

<body bgcolor="#FFF"> 
    <table class="body-wrap"> 
        <tr> 
            <td class="container"> 
                <div class="content"> 
                    <div id="logo">
                        <a href="http://www.example.com/"><img src="https://example.com/images/pic.png" /></a>
                    </div> 
                    <form action=""style="text-align:center;">
                    <input type="button" value="News"> <input type="button" value="Twitter"> <input type="button" value="Issues"> <input type="button" value="Info">
                    </form>
                    <td class ="container">
                        <div class="content">
                            <div id="feed"></div> 
                            <a href="http://twitter.com/" style="text-decoration:none;"><img src="http://example.com/images/icon_twitter.png" alt=""> Follow us on Twitter</a>
                        </div>
                    </td>
                    <td class ="container">
                        <div class="content">
                            <div id="feed"></div> 
                            <a href="http://twitter.com/" style="text-decoration:none;"><img src="http://example.com/images/icon_twitter.png" alt=""> Follow us on Twitter</a>
                        </div>
                    </td>
                </div> 
            </td>
        </tr> 
    </table> 
</body>


我需要通过单击按钮News和Twitter在相邻的两个容器之间切换。(在本例中,我有意将它们保留为相同的内容)稍后,我还将添加问题和信息的容器。如果有人知道怎么做,如果你能告诉我,我将不胜感激。我对HTML相当陌生,所以如果你能让你的解释保持简单,那也会有帮助。此外,我更愿意将所有代码保存在一个HTML文件中

JavaScript。这是非常基本的东西。是时候出书了。你说的“在容器之间切换”是什么意思?当有人单击某个按钮时,是否希望显示另一个容器?如果是这样的话,在没有javascript的情况下,使用现有标记是无法实现的。不使用表格,请使用普通html
,因为您是html新手,这里有一个快速的示例。@mdesdev这正是我想要的,也感谢您的快速回复。