I need to get only the lang value of the clicked item, but it only takes the first value. I do not know how to solve
php:
$i = 0;
while($rowFoto = mysqli_fetch_array($matrizFoto))
{
echo "<div id='blockfoto'>";
echo "<img class='fotoaltera mostraimagem' src='upload/Produtos/".$rowFoto["FotoProduto"]."'/><br/><br/>";
echo "<label class='file' for='filealtera'>Alterar</label>";
echo "<input type='hidden' class='amostra' lang='$i'/>";
echo "<input type='file' name='filealtera' id='filealtera' class='filealtera'>";
echo "</div>";
$i++;
}
Script:
$('.filealtera').change(function(){
var classe = $('.amostra').attr("lang");
readURL(this);
alert(classe);
});