Benutzer:Siedler6/common.js: Unterschied zwischen den Versionen
Aus SchnuppTrupp
(Test) |
|||
| Zeile 1: | Zeile 1: | ||
| − | var $rows = $('#table tr'); | + | /*var $rows = $('#table tr'); |
$('#search').keyup(function() { | $('#search').keyup(function() { | ||
var val = $.trim($(this).val()).replace(/ +/g, ' ').toLowerCase(); | var val = $.trim($(this).val()).replace(/ +/g, ' ').toLowerCase(); | ||
| Zeile 7: | Zeile 7: | ||
return !~text.indexOf(val); | return !~text.indexOf(val); | ||
}).hide(); | }).hide(); | ||
| − | }); | + | });*/ |
| + | |||
| + | function myFunction() { | ||
| + | var txt; | ||
| + | var person = prompt("Please enter your name:", "Harry Potter"); | ||
| + | if (person === null || person === "") { | ||
| + | txt = "User cancelled the prompt."; | ||
| + | } else { | ||
| + | txt = "Hello " + person + "! How are you today?"; | ||
| + | } | ||
| + | document.getElementById("demo").innerHTML = txt; | ||
| + | } | ||
Version vom 22. Oktober 2018, 22:24 Uhr
/*var $rows = $('#table tr');
$('#search').keyup(function() {
var val = $.trim($(this).val()).replace(/ +/g, ' ').toLowerCase();
$rows.show().filter(function() {
var text = $(this).text().replace(/\s+/g, ' ').toLowerCase();
return !~text.indexOf(val);
}).hide();
});*/
function myFunction() {
var txt;
var person = prompt("Please enter your name:", "Harry Potter");
if (person === null || person === "") {
txt = "User cancelled the prompt.";
} else {
txt = "Hello " + person + "! How are you today?";
}
document.getElementById("demo").innerHTML = txt;
}