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:
@@ -817,6 +817,22 @@ var overviewer = {
|
||||
|
||||
var searchInput = document.createElement("input");
|
||||
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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user