hej nie moge dojsc czemu nie dziala
index.html
<!DOCTYPE html>
<html>
<head>
<script type=“text/javascript” src=“scripts.js”>
</script>
<link rel=“stylesheet” href=“styles.css”>
</head>
<body>
Name: <input type=“text” id=“sampleText” value=“Michal”>
<p>Click the button to change the value of the text field.</p>
<button onclick=“sampleFunction()”>Try it</button>
</body>
</html>
scripts.js
<script>
var yourArray = [
['123', '647'],
['234', '222'],
['345', '333']
];
function sampleFunction() {
var sampleText = document.getElementById("sampleText");
yourArray.forEach(function (el) {
if (el[0] == sampleText.value) {
sampleText.value = el[1];
}
});
}
</script>
pole do wpisania , guzik ,
po nacisnieciu guzika
numer z pola do wpisania powinien sie zamienic na obiekt ktory do niego chce przypisac
a stoi w miejscu nie zmienia sie na to co chce ? jakis fix
(sorry nie mam polskich znakow angielska klawiatura angielski system)