Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dynamically align a div?

Status
Not open for further replies.

safra

Technical User
Jan 24, 2001
319
NL
Hi,

Can anybody show me the correct code to dynamically change the alignment of a div?

I tried this for for example IE 5.5 but didn't work:

<script>
changeAlign=document.getElementById(&quot;DIV&quot;)
changeAlign.style.align='right'
</script>

Thanks,

Ron
 
Thanks, that worked!

Anybody knows a reference list of the correct syntax for this sort of things (most of the time the syntax seems to be different for dynamic scripts compared to css!).

regards,

Ron

 
It's usually not too hard to figure out. Most of the time if it's something like text-align or background-color in css, it'll be textAlign or backgroundColor in javascript...
 
Thanks, I will keep that in mind the next time I'm struggling with something like this!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top