Home > Backend Development > PHP Tutorial > html标签select的有关问题 数据查询结果显示在上拉菜单中

html标签select的有关问题 数据查询结果显示在上拉菜单中

WBOY
Release: 2016-06-13 12:52:34
Original
1061 people have browsed it

html标签select的问题 数据查询结果显示在下拉菜单中
html select下拉菜单中有自己手动添加进来的菜单,比如


现在我从数据库中查询的结果是2,如何让页面显示的时候,下拉菜单自动锁定在“价值2”呢?

select html 数据显示
------解决方案--------------------

$value = 2;
echo "<script>document.getElementById('name').value = $value</script>";
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template