It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming HTML Forum

How do I make a link load a div?

How do I make a link load a div?

Postby jimmccrest on Tue Jan 25, 2011 2:59 pm

Hi everyone, I know this is a stupid question but I can't figure out how to make a link load a div. I have

Code: Select all
<html>
<head>
<style type="text/css">
#lock { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background-color: #000; opacity: 0.7; }
</style>
</head>
<body>
<p>This page will be locked if you <a onclick="lock" href="mailto:billgates@msn.com">click here</a></p>
</body>
</html>


Any help will be appreciated.
jimmccrest
 
Posts: 2
Joined: Tue Jan 25, 2011 2:34 pm

Re: How do I make a link load a div?

Postby jimmccrest on Tue Jan 25, 2011 4:14 pm

What I mean is that clicking the link should make it do what the following automatically does.
Code: Select all
<html>
<head>
<style type="text/css">
#lock { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background-color: #000; opacity: 0.7; }
</style>
</head>
<body>
<div id=lock></div>
</body>
</html>
jimmccrest
 
Posts: 2
Joined: Tue Jan 25, 2011 2:34 pm

Re: How do I make a link load a div?

Postby HotNoob on Tue Jan 25, 2011 8:29 pm

lol...
Code: Select all
<div id=lDiv><a onclick="document.getElementById('bodyDiv').style.display=''; document.getElementById('lDiv').style.display='none';">Show Content</a></div>
<div id=bodyDiv style="display:none;">body content</div>


you should learn your css and javascript.
HotNoob
100+ Club
 
Posts: 169
Joined: Sun May 02, 2010 1:38 am

Re: How do I make a link load a div?

Postby toldois on Sat Feb 19, 2011 10:17 am

That is very intersting inormations, thank you:)
toldois
 
Posts: 2
Joined: Sat Feb 19, 2011 7:34 am


Who is online

Users browsing this forum: No registered users and 6 guests