html - 如何将默认值传递给
问题描述
解决方案
您可以将此脚本添加到 HTML 文件的底部,该文件将在呈现后设置选择值。
<script>
document.getElementById('role').value = '<?= memRole; ?>'
</script>
推荐阅读
- javascript - 是否可以仅相对于您的元素获取鼠标位置
- vue.js - 在全局应用组件中渲染一个子组件
- docker - jwilder/nginx-proxy 503 服务暂时不可用
- django - 有没有办法将 Django 模板中的一些文本捕获为模板变量?
- docker - CORS 在带有 NGINX 的 Docker-Compose Stack 中某处失败-找不到
- kotlin - lateinit 属性没有被 dagger 和 coroutine 初始化
- java - Java/Regex - 匹配所有内容直到下一次匹配
- android - Android:RecyclerView 填充防止全屏体验
- javascript - 关闭 WebView 弹出窗口不会返回到 WebView
- react-native - 无法在 Android 模拟器中更改位置