Andrew Poulos wrote:
If I have code that looks like this:
<div id="myID">
<script type="text/javascript">
var foo = function() {
// refer to the id myID here
};
</script>
</div>
how can the function "foo" reference the parent container DIV's id
without me having to hard code it?
Andrew Poulos
I don't know if it would be suitable in your case, but you could
document write a marker DIV that you could search for and get it's
parentNode.
<div id="myID">
<script type="text/javascript">
var foo = function() {
// refer to the id myID here
var theDiv = document.getElementById("mymarker").parentNode;
};
document.write("<div id='mymarker'></div>");
</script>
</div>