• 0

Target a DIV?


Question

6 answers to this question

Recommended Posts

  • 0

it might be possible using javascript.

I know you can address the tag from javascript if you set an id with the getElementById method.

eg:

<html>
	<head>
  <script>
 	 function changeText() {
 	 document.getElementById('text').innerHTML = 'Another test text';
 	 }
  </script>
	</head>
	<body>
  <div ID="text">Test text</div>
  <br><br>
  <a href="javaScript:changeText()">Change the text</a>
	</body>
</html>

Link to comment
https://www.neowin.net/forum/topic/174764-target-a-div/#findComment-2231069
Share on other sites

  • 0

Are you talking about where you click a link, and it goes to another portion of the same page..

If so..

<html>
<head>
<title>Page Anchors</title>
</head>
<body>
<div>
<p><a href="#anchor">Go to the anchor named "anchor"</a></p>
</div>
<br />
<div>
<a name="anchor"> </a>
<p>The above link should have brought you here</p>
</div>
</body>
</html>

Link to comment
https://www.neowin.net/forum/topic/174764-target-a-div/#findComment-2246649
Share on other sites

  • 0
  still_idiot said:
Are you talking about where you click a link, and it goes to another portion of the same page..

If so..

<html>
<head>
<title>Page Anchors</title>
</head>
<body>
<div>
<p><a href="#anchor">Go to the anchor named "anchor"</a></p>
</div>
<br />
<div>
<a name="anchor"> </a>
<p>The above link should have brought you here</p>
</div>
</body>
</html>

Nah, he's saying he wants to have content show up in a DIV. Like a frame or iframe. I like this style much better. Problem is, I only know how to with PHP

Link to comment
https://www.neowin.net/forum/topic/174764-target-a-div/#findComment-2247257
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.