0
I need to take only the lang value of the clicked item, but only takes the first value. I don’t 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);
});
Ta returning Undefined
– Eduardo Ferreira