<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
div.main1{
background-color:#EEE;
border: 2px dotted;
padding: 5px;
}
div.sub{
background-color:#DDD;
border: 1px dashed;
padding: 3px;
width:50%;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<script type="text/javascript">
function showOptions(box){
box.childNodes[0].style.visibilty = "visible";
box.childNodes[1].style.visibilty = "visible";
}
function hideOptions(box){
box.childNodes[0].style.visibilty = "hidden";
box.childNodes[1].style.visibilty = "hidden";
}
</script>
<center>
<div class="main1">
<div class="sub" onmouseover="showOptions(this);" onmouseout="hideOptions(this);"><input />
</div>
</center>
</body>
</html>
Above is an example of the code I am using, i am using Dreamweaver… My concern is that When i Ctrl + Space after “box” in the showOptions(box) method, i don’t see any of the DOM object options, i apologise if i’m making no sense because im quite new to HTML + Javascript, basically what im trying to do is check if the given argument to the function of a HTML Element, and if so, allow me to access its methods such as “childNodes” or “setAttribute()” and so on..
Is this possible?
What you’re describing is called Intellisense/code hinting. From what I understand, Dreamweaver doesn’t do a very good job with this.
have you thought about using a different editor? If you’re working with mainly code other than .Net then maybe something like Komodo Edit.
If you’re going down the .Net route then there is of course Visual Studio Express which does a much better job with Intellisense/code hinting
Edit
Also, you’re attempting to see the intellisense on the method itself – this isn’t the intention. It’s intended to look AT the method from somewhere else. So ideally you would do your CTRL+space where shown below:
Another Edit
Also, looking at your code, it’s not going to work..
You are referencing a child that doesn’t exist:
childNodes starts at zero, so
[0]would be theinput.[1]is nothing.Finally
Might I suggest you install Firefox and Firebug. Firebug will help you debug all your javascript. It does a GREAT job of telling you what/where the issue is.