Okay, I'm trying to do something, and I have no idea what's going on. Without having to spend a long time learning another programming language, all I want to do is target a div with a link from another div.

http://www.vinceswebservices.com/bmcleod/main.html

Okay, what I want is to click the Menu link on the left, and have the page show up in the #maincontent div in the middle.

I miss frames. They were so easy. Target=

Also, please, be very specific where I am putting things.

Member Avatar for rajarajan2017

You can replace another div with below code:

<script type="text/javascript">
<!--
function switchPic(picID)
{

document.getElementById(picID).innerHTML ="<h1>Test</h1>";
}
//-->
</script>
</head>

<body>
    <div id="div1">Link 1</div>
    <a href="javascript:void(0);" onclick="switchPic('div1');">Hide Div</a>
</body>

Hi. This is what I was also asking about. Where do I put that? In the body of my code, I have 3 different divs, where do I put it? Where is the link? I see "Link 1", and an href to "javascript:void", but where do I put the page I want to link to?

This doesn't make any sense to me, because I don't know how this works. If I want the menu page to show up in the middle after the link on the left is clicked, how does this do that?

I appreciate your help, I just can't understand what to do.

Please check the site to see what this did....

Also, when I put the script in the head, I now have a syntax error at #framecontentTop. Why did it do that?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.