现在我有这个代码:
<script type="text/javascript">
function delete_box(n) {
document.getElementById("box"+n).style.display = "none";
}
<script>
<div id="box1">
<table>
<td>some code</td><td><input type="button" value="Delete this box" onclick="delete_box(1)"></td>
</table>
</div>
Run Code Online (Sandbox Code Playgroud)
它工作正常。当我按下按钮时,框消失了。但是我想简化并像这样:
<script type="text/javascript">
function delete_box(n) {
document.getElementById(n).style.display = "none";
}
<script>
<div id="box1">
<table>
<td>some code</td><td><input type="button" value="Delete this box" onclick="delete_box(this.parentnode.id)"></td>
</table>
</div>
Run Code Online (Sandbox Code Playgroud)
但是它不会按预期工作。控制台说 id 为空,我不知道为什么。我做错了什么?
谢谢你。
我尝试在列表框中进行预选,但它不起作用.
当我尝试其他选项,如标签或其他工作,但选择不.
这是我的代码:
$form->field($model, 'offerCategory')->listBox([
'monday' => 'Monday',
'tuesday' => 'Tuesday',
'wednesday' => 'Wednesday',
'thursday' => 'Thursday',
'friday' => 'Friday',
'saturday' => 'Saturday',
'sunday' => 'Sunday'],
['options' => ['monday' => ['selected' => 'selected'],
'tuesday' => ['selected' => 'selected'],
'wednesday' => ['label' => 'test']
],
'multiple' => 'true',
])
Run Code Online (Sandbox Code Playgroud) Apache Camel中camelContext和routeContext有什么区别?何时使用camelContext和routeContext?
我已经在Linux上配置了Google身份验证器,并且我的mfa正常运行,但是根据我的说法,MFA令牌应在30秒后过期,但即使在30秒后,我仍可以使用该令牌。
如果我使用令牌,则该令牌不可重复使用,但如果在30秒钟内不使用它,那么我也可以在一段时间后使用它。这正常吗?我希望我的令牌在30秒内过期,即使我使用或不使用它也是如此。有人可以帮我吗?