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

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

WBOY
WBOYOriginal
2016-06-13 12:52:341000browse

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


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

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

$value = 2;
echo "<script>document.getElementById('name').value = $value</script>";
Statement:
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