I have a JSFiddle here http://jsfiddle.net/yqh2rqh0/25/ and it works perfectly fine. But then I tried to decompose all the styles of code and actually add it to my website, which is www.localhost/home.html and I created a home.html page, where I put:
<html>
<head>
<link type="text/css" href=“homestyle.css" rel="stylesheet" />
<script type="text/javascript”; src=“homejavascript.js”;></script>
</head>
<body>
<input type="button" name="answer" value="post" onclick="openBox()" />
<div id="postBox" style="display:none;">
<center>
<input type="text" name="post" maxlength="100" />
<br>
</br>
<button style="border : solid 0px #000080; border-radius : 4px; moz-border-radius : 4px; -webkit-box-shadow : 0px 0px 5px rgba(0, 0, 0, 1.0); -moz-box-shadow : 0px 0px 5px rgba(0,0,0,1.0); box-shadow : 0px 0px 5px rgba(0,0,0,1.0); font-size : 24px; font-style : ;color : #ffffff; padding : 4px 10px; background-color : #000080;">post</button>
<br/>
<br/>
<center>
<table class="rows"></table>
</center>
</center>
</div>
</body>
</html>
And then I have my Javascript (homejavascript.js) file:
var btn = document.getElementsByTagName("button")[0];
var inpt = document.getElementsByName("post")[0];
function openBox() {
document.getElementById('postBox').style.display = "block";
}
btn.onclick = function () {
if (!inpt.value) alert("Please enter something to post.");
var tbl = document.getElementsByTagName("table")[0];
var row = tbl.insertRow(0);
var cell = row.insertCell(0);
var txt = document.createTextNode(inpt.value);
cell.appendChild(txt);
tbl.insertRow(0);
tbl.insertRow(0);
inpt.value = "";
};
And lastly my homestyle.css file which is the CSS part:
input[type=text] {
padding:5px;
border:2px solid #000080;
-webkit-border-radius: 5px;
border-radius: 5px;
}
input[type=text]:focus {
border-color:#ccc;
}
-webkit-border-radius: 5px;
border-radius: 5px;
}
.rows {
text-align: center;
}
All are in my htdocs folder of XAMPP, but when I go to localhost/home.html, it is a blank page with the proper favicon. Where did I go wrong and what can I do to fix this?
“and”needs to be changed to".