简单的dom问题
说我有,
<div id="searchform">
<div style="float:right">
<a href="~">Advanced Search</a>
</div>
<div id="resultStats">
About 5 trillion results
</div>
</div>
我只需要把第一个孩子改为float:bottom而不是float:right。
谢谢你们的帮助!我是认真的!所以当我将其输入到 chrome 控制台时,它不起作用。在我的 Sweet Search ext 中,它显示“无法读取 null 的属性‘childNodes’”
document.getElementById("subform_ctrl").childNodes[0].style = 'float:bottom';
(注意:id 是“subform_ctrl”)
say I have
<div id="searchform">
<div style="float:right">
<a href="~">Advanced Search</a>
</div>
<div id="resultStats">
About 5 trillion results
</div>
</div>
I just need to change the first child to float: bottom instead of float:right.
Thank you guys for your help! I really mean it! So when I enter this into the chrome console, it doesn't work. Within my Sweet Search ext, it says "Cannot read property 'childNodes' of null"
document.getElementById("subform_ctrl").childNodes[0].style = 'float:bottom';
(Note: id is 'subform_ctrl')
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
但我认为 float = Bottom 无效。
那么,您真正想要实现的目标是什么?
BUT I don't think float = bottom is valid.
So, what is it that you are really trying to accomplish?
浮:底部! (顶部?!)
浮动:底部?当然!
下一个版本我将删除“关于”,将“结果”换成“in”,并且删除“秒”并仅显示秒数(如果它长于 0.5)
Float: bottom! (top?!)
Float: bottom? Sure!
Next release I am gonna delete 'About' trade 'results' for 'in' and delete 'seconds' and only show the seconds if it's longer than .5