470,581 Members | 2,438 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,581 developers. It's quick & easy.

ahhh!

Is there any way to pass the value of a javascript variable to a DIV
property value, e.g. <div style="position:absolute; top: 'gap'+px';> ... so
basically i want the div top property to be the variable gap from my
javascript. any ideas?

decibel
Jul 20 '05 #1
1 1080
<script language = "javascript" type = "text/javascript">

var gap = document.getElementById('theDIV').style;

gap.top = '100px';

// or

gap.top = 100;

</script>

decibel wrote:
Is there any way to pass the value of a javascript variable to a DIV
property value, e.g. <div style="position:absolute; top: 'gap'+px';> ... so
basically i want the div top property to be the variable gap from my
javascript. any ideas?

decibel

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Peter Abel | last post: by
33 posts views Thread by Nick Evans | last post: by
11 posts views Thread by Jerry Boone | last post: by
98 posts views Thread by jacob navia | last post: by
3 posts views Thread by jmprescott | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.