I'm very new to programming. Ive used w3schools and freecodecamp to learn.
I know the basics within objects, arrays, functions and loops.
I know that I can write something like this to change an image.
function a(b) {var t; if(b === 1){t = "image.jpg"} document.getElementById("aide").src= t; } <br>button onclick="a(1)" <br>
img id="aide src="some.image"
How would a professional programmer do this? Is that called dom as i need to write onclick in html?
and.. I can make object/arrays such as var x = [{ rock: "Metallica" }];. I want a type="text" bar on a webpage that displays Metallica when a user writes Rock in the text field and submits it. How, and without dom if possible?