forms - 在哈巴狗中动态形成队形
问题描述
我正在尝试根据用户输入的数字填充输入字段,但无法做到这一点得到错误
Cannot read property 'querySelector' of undefined"
为什么文档未定义?
我的哈巴狗文件
extends base
block content
form.createCourseForm
input.form-control#name(type = 'text ' placeholder = 'course name')
input.form-control#duration(type = 'text ' placeholder = 'course duration')
input.form-control#img(type = 'text ' placeholder = 'course image')
input.form-control#price(type = 'text ' placeholder = 'course price')
input.form-control#description(type = 'text-area ' placeholder = 'course description')
label curriculum
-const el = document.querySelector('#duration').value;
let v = el
while v>0
input#week(type="text" placeholder = 'week ')
input#wdescription(type="text-area" placeholder = 'week description')
label lessons
input#lname(type="text" placeholder = 'lesson name')
input#llink(type="url", name="llink" placeholder = 'lesson link')
-v=v-1
button.btn.btn-primary create course
解决方案
推荐阅读
- sql - 如何根据相邻行计算结果满足某些条件
- python - 如何在 python tkinter 画布中使用 create_line 创建五边形和六边形?
- mysql - 显示其他表中每一行的所有数据和计数
- angular-material - 在编辑组件中设置下拉值
- java - 如何解决 wsdl 文件中的消息标签错误?
- libgdx - 在某个原点旋转后获取 Actor 位置
- php - 如何在 PHP 中分解具有多位数字的整数数组
- c# - 如何从 c# 的 knx 组地址学习传感器数据?
- tensor2tensor - 如何在tensor2tensor中使用F1分数
- .net - IIS 错误 启动应用程序时发生错误