the subject says it all :)
thanks in advance,
Michael
the subject says it all :)
thanks in advance,
Michael
Yes you can, but what do you mean by "object" tag?
I may be thinking of DOM3 (which isn't standard, yet), but you can access the value of anything with getElementByID, getAttribute, getChild, and stuff like that.
Good places to start is post and example of what you are trying to do, or check out developer.netscape.com, or www.w3c.org.
what i mean by the object tag is like thisQuote:
Originally posted by CiberTHuG
Yes you can, but what do you mean by "object" tag?
I have been trying, and you're probably going to yell at me...Code:<OBJECT ID="CantFindThisElement" DATA="blah.html" TYPE="text/html" WIDTH=300 HEIGHT=300>
</OBJECT>
and variants of that but havent found anything that will work.Code:document.all.CantFindThisElement.data.value
Thanks
Michael
This works for IE6 and Mozilla 0.9.9:
Code:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Untitled</title>
<script type="text/javascript">
function testf() {
var vo = document.getElementById("CantFindThisElement");
alert(vo.data);
vo.data = "http://www.google.com/";
alert(vo.data);
}
</script>
</head>
<body>
<OBJECT ID="CantFindThisElement" DATA="blah.html" TYPE="text/html" WIDTH=300 HEIGHT=300>
</OBJECT>
<span onclick="testf();">CLICK</span>
</body>
</html>
thanks :)
michael
Yes, I should yell at you because there is no document.all. :)
But as Josh showed, document.getElementById works. If you look at www.w3c.org/DOM you can look at the DOM 2 recommendations and find something that may work in IE 5.x or other older browsers.
I had the object in a 'form' so thats why i had document.all (but ASP/VB is my forté javascript/DOM is a bit new for me)
thanks again,
Michael