/* inline edit fields */ $(document).ready(function() { /* troca cloak por hide to jquery */ $(".cloak").each(function () { $(this).removeClass('cloak').toggle(); console.log($(this)+" | "+$(this).css('display')); }) /* foreach editable field */ $(".canedit").each(function(){ console.log('-----------------------------------') /* this canedit */ var canedit = $(this); console.log('canedit -> '+canedit); /* get input */ var theinput = $(this).children("input"); console.log('theinput -> '+theinput.html()); // returns that not have properties (not exist) /* start edit */ $(".canedit span.edit").click(function() { console.log("span.edit -> "+$(this).html()) /* hide span with text, show input */ $(this).hide('fast',function(){ console.log(this) theinput.show('fast');}) canedit.children(".editbuttons .edit").hide('fast',function() { canedit.children(".editbuttons .save").show('fast'); }); }) }); })