Personal this is my code in PHP
$sql = mysql_query("SELECT * FROM noty");
while($linha = mysql_fetch_array($sql)){
$notificacao = $linha["notificacao"];
echo"<div class='adm_edit'>".$notificacao."
<input type='text' class='input_edit' value='".$notificacao."'/>
</div>";
}
As you can see I'm getting the information from the bank and showing. So far so good, but the problem comes in JQuery
.
$(document).ready(function(){
$(".adm_edit").on("click", function() {
$(this).children(".input_edit").show();
$("#exit_edit").show();
});
$("#exit_edit").click(function() {
$(".adm_edit").text($(".input_edit").val());
$(".input_edit").hide();
$("#exit_edit").hide();
});
});
Each content that is generated by the bank as you can see has an invisible Input
that is displayed when the user clicks on the content. The problem comes after that which is when I would like when the Input
when it was closed the contents typed there would be the Div
that was clicked.