mustafaelrasheid
mustafaelrasheid
KPCKevin Powell - Community
Created by IAM on 5/2/2024 in #front-end
hello my first time problem click button idk
because it is too much code for the client to load
91 replies
KPCKevin Powell - Community
Created by IAM on 5/2/2024 in #front-end
hello my first time problem click button idk
html file:
<html>
<head>
<link rel="stylesheet" href="css/2001_mars_odyssey.css" id="normal">
<link rel="stylesheet" href="hi.css">
</head>
<body>
<div id="button-container">
</div>
<input id="middle-input"/>
</body>
</html>
<html>
<head>
<link rel="stylesheet" href="css/2001_mars_odyssey.css" id="normal">
<link rel="stylesheet" href="hi.css">
</head>
<body>
<div id="button-container">
</div>
<input id="middle-input"/>
</body>
</html>
js file"
document.addEventListener(
'DOMContentLoaded',
() => {
for (let i = 1; i <= 64; i++) {
let button = document.createElement("button");
let array = "your text";
button.something = array[i];
button.onclick = (event) => {
console.log(event.target.something);
document.getElementById("middle-input").value = event.target.something;
};

document.getElementById("button-container").appendChild(button);
}
}
);
document.addEventListener(
'DOMContentLoaded',
() => {
for (let i = 1; i <= 64; i++) {
let button = document.createElement("button");
let array = "your text";
button.something = array[i];
button.onclick = (event) => {
console.log(event.target.something);
document.getElementById("middle-input").value = event.target.something;
};

document.getElementById("button-container").appendChild(button);
}
}
);
91 replies
KPCKevin Powell - Community
Created by IAM on 5/2/2024 in #front-end
hello my first time problem click button idk
91 replies
KPCKevin Powell - Community
Created by IAM on 5/2/2024 in #front-end
hello my first time problem click button idk
your native tough?
91 replies
KPCKevin Powell - Community
Created by IAM on 5/2/2024 in #front-end
hello my first time problem click button idk
what is your home language by the way?
91 replies
KPCKevin Powell - Community
Created by IAM on 5/2/2024 in #front-end
hello my first time problem click button idk
with less bloat
91 replies
KPCKevin Powell - Community
Created by IAM on 5/2/2024 in #front-end
hello my first time problem click button idk
see, it works
91 replies
KPCKevin Powell - Community
Created by IAM on 5/2/2024 in #front-end
hello my first time problem click button idk
No description
91 replies
KPCKevin Powell - Community
Created by IAM on 5/2/2024 in #front-end
hello my first time problem click button idk
did it work?
91 replies
KPCKevin Powell - Community
Created by IAM on 5/2/2024 in #front-end
hello my first time problem click button idk
what do you see?
91 replies
KPCKevin Powell - Community
Created by IAM on 5/2/2024 in #front-end
hello my first time problem click button idk
document.addEventListener(
'DOMContentLoaded',
() => {
for (let i = 1; i <= 64; i++) {
let button = document.createElement("button");
let array = ["h","b","",...];
let item = array[i];
button.onclick = () => {
console.log(item);
};
document.getElementById("button-container").appendChild(button);
}
}
);
document.addEventListener(
'DOMContentLoaded',
() => {
for (let i = 1; i <= 64; i++) {
let button = document.createElement("button");
let array = ["h","b","",...];
let item = array[i];
button.onclick = () => {
console.log(item);
};
document.getElementById("button-container").appendChild(button);
}
}
);
91 replies
KPCKevin Powell - Community
Created by IAM on 5/2/2024 in #front-end
hello my first time problem click button idk
<html>
<head>
<link rel="stylesheet" href="css/2001_mars_odyssey.css" id="normal">
<link rel="stylesheet" href="hi.css">
</head>
<body>
<div id="button-container">
</div>
</body>
</html>
<html>
<head>
<link rel="stylesheet" href="css/2001_mars_odyssey.css" id="normal">
<link rel="stylesheet" href="hi.css">
</head>
<body>
<div id="button-container">
</div>
</body>
</html>
91 replies
KPCKevin Powell - Community
Created by IAM on 5/2/2024 in #front-end
hello my first time problem click button idk
give me sometime
91 replies
KPCKevin Powell - Community
Created by IAM on 5/2/2024 in #front-end
hello my first time problem click button idk
your spaghetti code seems tuff to fix
91 replies
KPCKevin Powell - Community
Created by IAM on 5/2/2024 in #front-end
hello my first time problem click button idk
we are getting there...
91 replies
KPCKevin Powell - Community
Created by IAM on 5/2/2024 in #front-end
hello my first time problem click button idk
did it work?
91 replies
KPCKevin Powell - Community
Created by IAM on 5/2/2024 in #front-end
hello my first time problem click button idk
document.addEventListener('DOMContentLoaded', () => {
for (let i = 1; i <= 64; i++) {
let button = document.getElementById('b' + i);
button.click = () => {
console.log(button.innerText);
document.getElementById('middle-input').value = button.innerHTML;
};
}
});
document.addEventListener('DOMContentLoaded', () => {
for (let i = 1; i <= 64; i++) {
let button = document.getElementById('b' + i);
button.click = () => {
console.log(button.innerText);
document.getElementById('middle-input').value = button.innerHTML;
};
}
});
91 replies
KPCKevin Powell - Community
Created by IAM on 5/2/2024 in #front-end
hello my first time problem click button idk
window.onload = function() {
for (let i = 1; i <= 64; i++) {
let button = document.getElementById('b' + i);
button.onclick = () => {
console.log(button.innerText);
document.getElementById('middle-input').value = button.innerHTML;
};
}
};
window.onload = function() {
for (let i = 1; i <= 64; i++) {
let button = document.getElementById('b' + i);
button.onclick = () => {
console.log(button.innerText);
document.getElementById('middle-input').value = button.innerHTML;
};
}
};
91 replies
KPCKevin Powell - Community
Created by IAM on 5/2/2024 in #front-end
hello my first time problem click button idk
try using innerHTML instead of inner text
91 replies
KPCKevin Powell - Community
Created by IAM on 5/2/2024 in #front-end
hello my first time problem click button idk
try using () => {} instead of function() {}
91 replies