如何使下拉菜单只加载文本而不是整个新的页面? [英] How to make dropdown menu that only loads the text not whole new page?

查看:129
本文介绍了如何使下拉菜单只加载文本而不是整个新的页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于我的常见问题页面,我想要的问题显示在一个下拉菜单,他们点击它,然后它显示的问题,然后根据他们选择的问题显示以下答案。

For my F.A.Q page I want the questions displayed in a drop menu where they click on it and then it displays the questions and then depending on which question they choose it shows the answer below.

我想让它不会带你到一个新的页面,我只是想让它显示的问题的答案。

I want to make it so that it does not take you to a whole new page I just want it to display the answer to the question.

推荐答案

有两个元素,选择框和答案文本框可能是一个< p> 标签。

Have 2 elements, the selection box, and the answer text box probably a <p> tag.

取决于选择框的值,让JS脚本将答案文本的 innerHTML 更改为某个字符串。

Depending on the value of the selection box, have the JS script change the innerHTML of the answer text to some string.

如果你不知道一些,一个快速的google搜索可能有帮助,或者只是问。

If you don't know about some of this, a quick google search might help, or just ask.

这篇关于如何使下拉菜单只加载文本而不是整个新的页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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