我有一个输入,height: 250px你可以看到它的文本位于中心.有没有办法将它对齐到左上角?
#messageBox
{
width: 200px;
height: 250px;
}Run Code Online (Sandbox Code Playgroud)
<input id="messageBox">Run Code Online (Sandbox Code Playgroud)
好吧,我有一些id ='0','1','2','3'等复选框.所以我需要获取复选框的文本.这是PHP中的复选框代码.
'<input id="'.$i.'"type="checkbox" name="option1" value="a1" onclick="checkYears()">'.$years[$i].'</input>
Run Code Online (Sandbox Code Playgroud)
所以我需要获得$ years [$ i] -value.我正在使用此代码.
while (bool==false)
{
if (document.getElementById(i)!=null)
{
if (document.getElementById(i).checked)
{
years.push(1);
yearsValue.push(document.getElementById(i).innerHTML);
document.getElementById(i).innerText="WORKS";
console.log(yearsValue[i]);
}
else
{
years.push(0);
yearsValue.push(document.getElementById(i)).innerHTML);
console.log(yearsValue[i]);
}
}
else
{
bool=true;
}
i++;
}
Run Code Online (Sandbox Code Playgroud)
0和1都添加正常,但是当我尝试使用innerHTML时,在consle中存在和未定义的值.
有什么建议?
我有一个表,其中一个td表格有输入和提交按钮.我想完全删除输入框.可能吗?
http://jsfiddle.net/ajeozmwa/2/
我有3个要素:
<div class='first'>First</div>
<div class='second'>Second</div>
<div class='target'>Target</div>
Run Code Online (Sandbox Code Playgroud)
点击target div我.prev()在我的js 测试功能
$(document).on('click','.target',function(){
console.log($(this).prev().html());
console.log($(this).prev('.first').html());
});
Run Code Online (Sandbox Code Playgroud)
输出如下:'Second undefined',但应该是:'second first'如果我理解了.prev()用法的参数.我怎样才能获得某个类的第一个前一个元素呢?这是小提琴:http://jsfiddle.net/0fzgzce5/
我正在尝试通过yii\bootstrap\Html发送参数.
echo Html::a('???????', ['/orders/order-create','freelancer_group'=>$_GET['freelancer_group']], ['class'=>'btn btn-lg btn-primary','data'=>['method' => 'post','derp'=>'herp'],]);
Run Code Online (Sandbox Code Playgroud)
但是,当我点击它仍然var_dump($_POST['derp']);是 NULL.我该如何发布?我在这里找到了它