Finding the top of a moving div
I have a code snippet that looks like this:
- <div id="a">
- <div id="b">
- <p>text in b</p>
- </div>
- <div id="c">
- <p>text in c</p>
- </div>
- </div>
When I issue
- a = $('#a')
- b = $('#b')
- a.css('top', '50px')
- b.css('top')
at the console, i expected to see "50px" or close to it. Instead, "auto" appears.
Can anyone help me understand what I am doing wrong?