Question

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')

Was it helpful?

Solution

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?

OTHER TIPS

document.getElementById('searchform').childNodes[0].style = 'float:bottom';

Float: bottom! (top?!)

alt text

Float: bottom? Sure!

alt text

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top