simple dom question
-
10-10-2019 - |
سؤال
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')
المحلول
document.querySelector('#searchform *:first-child').style.float = 'bottom'
BUT I don't think float = bottom is valid.
So, what is it that you are really trying to accomplish?
نصائح أخرى
document.getElementById('searchform').childNodes[0].style = 'float:bottom';
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
لا تنتمي إلى StackOverflow