1
Hi, guys, I’m having a problem.
I have 4 equal tags, but I want to send the value of the tag that was clicked to the value of the input.
Example :
<img id="imgs" src="img_01">
<img id="imgs" src="img_02">
<img id="imgs" src="img_03">
<img id="imgs" src="img_04">
<input type="text" nome="selecionar_img" value="">
Suppose I click on the img of src 3, I need my input this way.
<input type="text" nome="selecionar_img" value="img_03">
And if I click another img tag the value field delete the previous value and put the new value of the tag that was clicked.
<input type="text" nome="selecionar_img" value="img_03"> // Valor anterior
<input type="text" nome="selecionar_img" value="img_01"> // Novo Valor passado
I thank anyone who can help me, I have no experience with Js but I need to do these events. obg ^-^
Sorry, by html I just typed here, I didn’t get the code I’m doing was just to make a shallow example msm, but js worked perfectly the way I wanted. obg for the help
– EDGNoizy
@Delacroix, no problem. As some novice may have some similar doubt and fall on this page, I evidenced these mistakes to prevent someone from reproducing them.
– Felipe Marinho