[英]Div is Not Displaying Input or Hiding Itself When Clicked
I am trying to make a div that hides itself when clicked and shows an input. 我试图制作一个div,它在点击时隐藏自己并显示输入。
My CSS: 我的CSS:
#btn {
width:100%;
height:100%;
display:block;
text-align:center;
}
#i1 {
display:none;
}
My JavaScript: 我的JavaScript:
<script>
document.getElementById('btn').onclick = function() {
document.getElementById('i1').style.display = 'block';
document.getElementById('btn').style.display = 'none';
}
</script>
My HTML: 我的HTML:
<div id="btn">Company</div><input id="i1" type="text" value="<?php echo"{$row['company']}";}?>">
Can anyone tell me why the Div is not hiding and, or, why the input is not showing? 任何人都可以告诉我为什么Div没有隐藏,或者,为什么输入没有显示?
Thank you for any help. 感谢您的任何帮助。 All help is appreciated.
所有帮助表示赞赏。
'Your quotes in your php are probably not helping and mess it up some. '你的php中的引用可能没有帮助,搞砸了一些。
Try: 尝试:
<?php
$row['company'] = "some company";
$company = $row['company']
?>
<input id="i1" type="text" value="<?php echo $company?>">
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.