Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
<script type="text/javascript">
count = 0;
function produkt() {
if (count == 0){
previous = document.form.text.value;
document.form.text.value += 'Produkt1';
count = 1;
} else if (count == 1) {
document.form.text.value = previous;
count = 0;
}
}
function produkt1() {
if (count == 0){
previous = document.form.text.value;
document.form.text.value += 'Produkt2';
count = 1;
} else if (count == 1) {
document.form.text.value = previous;
count = 0;
}
}
function produkt2() {
if (count == 0){
previous = document.form.text.value;
document.form.text.value += 'Produkt3';
count = 1;
} else if (count == 1) {
document.form.text.value = previous;
count = 0;
}
}
function produkt3() {
if (count == 0){
previous = document.form.text.value;
document.form.text.value += 'Produkt4';
count = 1;
} else if (count == 1) {
document.form.text.value = previous;
count = 0;
}
}
function produkt4() {
if (count == 0){
previous = document.form.text.value;
document.form.text.value += 'Produkt5';
count = 1;
} else if (count == 1) {
document.form.text.value = previous;
count = 0;
}
}
</ script>
if (count == 0)
{
// ...
count = 1;
} else if (count == 1) {
// ...
count = 0;
}
if (!count)
{
// ...
} else {
// ...
}
count = !count;
<html>
<head>
<script type="text/javascript" language="JavaScript">
<!--
var count;
function produkt(num) {
if (!count) {
previous = document.form.text.value;
document.form.text.value += "Produkt" + num;
count = 1;
} else if (count) {
document.form.text.value = previous;
document.form.text.value += "Produkt" + num;
}
}
//-->
</script>
<title>Blubb</title>
</head>
<body>
<form name="form">
<input type="text" name="text">
</form>
<a href="javascript: produkt(1);">1</a>
<a href="javascript: produkt(2);">2</a>
<a href="javascript: produkt(3);">3</a>
<a href="javascript: produkt(4);">4</a>
<a href="javascript: produkt(5);">5</a>
</body>
</html>