0

Added title field for sign search box, added default value which sets to nothing when focussed and resets when box is empty and blured.

This commit is contained in:
CounterPillow
2011-08-05 13:38:09 +02:00
parent c56f1d23c9
commit 3e4b7b4cd7

View File

@@ -817,6 +817,22 @@ var overviewer = {
var searchInput = document.createElement("input"); var searchInput = document.createElement("input");
searchInput.type = "text"; searchInput.type = "text";
searchInput.value = "Sign Search"
searchInput.title = "Sign Search"
/* Hey dawg, I heard you like functions.
* So we defined a function inside your function.
*/
searchInput.onfocus = function() {
if (searchInput.value == "Sign Search") {
searchInput.value = "";
}
};
searchInput.onblur = function() {
if (searchInput.value == "") {
searchInput.value = "Sign Search";
}
};
searchControl.appendChild(searchInput); searchControl.appendChild(searchInput);