Hi I am just messing around trying to learn some java scripting. I have a div that I am trying to center in another div based on resolution. So I have a external .CSS and a external .JS file that I am trying to use. The JS file is changing the left style of the div defined in the CSS file.
Here is my code:
Java code.
document.getElementById(‘EnterScreen’).style.left = “800px”;
Css code.
#EnterScreen
{
background: white;
position:absolute;
text-align: center;
border: solid 1px white;
padding: 1px;
margin: 1px;
}
This is in the head tag.
<script language=”javascript” src=”js/index.js”></script>
<link rel = “stylesheet” href = “css/index.css” />
Once I get the hard code to work then Ill get it to actually do what I want it to do with regards to the resolution. However, This doesn’t seem to work, I have used Alert() and it returns null. In the html file I have move the .JS to be loaded first and second to see if that would make a difference and nothing… Any help would be appreciated. Also I know that its case sensitive so EnterScreen is spelled out correctly.