Hi,
Mit match() und dem Ausdruck bekomme ich alle Einträge mit alert() angezeigt. Wie kann ich nun jedem Treffer einen anderen Wert verpassen?
Indem du die Treffer an eine Callback-Funktion übergibst, und diese den passenden Ersatzwert heraussuchen und zurückgeben lässt.
Weitere Erklärungen und ein Beispiel findest du hier: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#Specifying_a_function_as_a_parameter
MfG ChrisB
--
Autocomplete has spoiled me to a point where it happens every so often that I encounter a CAPTCHA, and I just type in the first character … and then wait for the rest of the code to be automatically suggested :/
Autocomplete has spoiled me to a point where it happens every so often that I encounter a CAPTCHA, and I just type in the first character … and then wait for the rest of the code to be automatically suggested :/