Is it possible to retrieve a specific part of a content page to display in a popup box?
Let's say we have a page called "content page" with the following structure:
<body>
<p id="part1">Tread ... inch. </p>
<p id="part2">Tread ... inch. </p>
<p id="part3">Tread ... inch.</p>
</body>
And on another page, we have some JavaScript code for a popup box as shown here:
<head>
<script type="text/javascript" src="popupBox.js"></script>
</head>
<body>
Show content of part one: <a href="TreadDepth.html" onClick="return show_hide_box(this,400,400,'2px solid')">Click Here</a>.
Show content of part two: <a href="TreadDepth.html" onClick="return show_hide_box(this,400,400,'2px solid')">Click Here</a>.
Show content of part three: <a href="TreadDepth.html" onClick="return show_hide_box(this,400,400,'2px solid')">Click Here</a>.
</body>
Now, in the popup.js file, can we target a specific ID from the href of the clicked link?
var href = an.href;
var boxdiv = document.getElementById(href).getElementById("Show The content of this ID tag!");
Any thoughts or suggestions?