Creating a Dynamic Div with JS

This is a discussion on "Creating a Dynamic Div with JS" within the JavaScript Forum section. This forum, and the thread "Creating a Dynamic Div with JS are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Feb 13th, 2007, 17:25
Junior Member
Join Date: Dec 2005
Location: Dublin
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Creating a Dynamic Div with JS

Hi,

Does anyone know how to create a div from within a JS function that will display on the screen when called? Im a bit of a JS novice, I was thinking maybe by setting the div to display: none in the CSS, but im not sure how to call to CSS from JS... any ideas?
Reply With Quote

  #2 (permalink)  
Old Feb 13th, 2007, 18:59
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Creating a Dynamic Div with JS

document.getElementById("yourdiv").style.display = "block";
document.getElementById("yourdiv").style.display = "none";

and if the property has a hyphen in it, use JS like this:

document.getElementById("yourdiv").style.backgroun dColor = "#ffffff";
Reply With Quote
Reply

Tags
dynamic div

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic Layout Dgrade Flash & Multimedia Forum 3 Mar 17th, 2008 03:03
Creating Dynamic Content deoxymonohydroxinate Starting Out 1 Feb 16th, 2008 18:23
[SOLVED] Creating multiple dynamic list boxes from mysql database davibugi PHP Forum 11 Nov 20th, 2007 06:12
Creating multiple dynamic list boxes from mysql database phoenix211984 Databases 1 Sep 27th, 2006 16:19
Dynamic Placement ClaireB JavaScript Forum 2 Sep 8th, 2005 10:45


All times are GMT. The time now is 22:38.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43