0
I have this html code:
<label>
<img class="jogo" value="lol" src="../cdn/img/jogos/lol.png">
<img class="jogo" value="csgo" src="../cdn/img/jogos/csgo.png">
</label>
<br><div class="atual"> </div>
I wanted in the div below to show the value of the images above ( lol /csgo )
$(function(){
$(".jogo").click(function(){
$(".jogo").animate({opacity:0.5},{duration:100});
$(this).animate({opacity:1},{duration:100});
var jogo = $(this).val();
$(".atual").html(jogo);
});
});
I don’t know how I do it :/
Code jsfiddle: http://jsfiddle.net/xj1L52h3/
______________________________________________
Edited
I have another question, I wanted to make sure that when I clicked on 1 of the images a menu appeared and when I clicked on the other one, what was already there disappeared and another appeared.
It worked perfectly, I thought the same thing about the tag
img
not work with thevalue
, but n knew how to solve. Thank you :)– xdam98
I edited the topic there, you can help me?
– xdam98
@xdam98 http://jsfiddle.net/xj1L52h3/8/
– DontVoteMeDown
Thanks, it all worked out.
– xdam98