Welcome visitor
* Login
* Register
It is currently May 20th, 2019, 6:40 am
All times are UTC [ DST ]
* Search
View unanswered posts - View active topics

FORUMS » Client Side » JavaScript



Post new topic Reply to topic  [ 2 posts ] 
Author Message
  Change or hide divs using JavaScript
PostPosted: August 13th, 2009, 8:51 pm 

Posts: 33
Hi, do you know the javascript to change or hide divs when the user clicks a button to make the page look as if it has changed to a different page but it is only the content that really changes.

Do you know how to do it or where i can find a scritp for this?

Regards.


Top
 Profile  
 
  Re: Change or hide divs using JavaScript
PostPosted: August 13th, 2009, 11:14 pm 

Posts: 56
onclick="document.getElementById('div1').style.display='none';
document.getElementById('div2').style.display='inline';" // inline or block

to change the content of a div use
document.getElementById('div1').innerHTML='<h1>hello!</h1>';


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

FORUMS » Client Side » JavaScript


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron