fork download
  1. $('.edit').click(function () {
  2. var id = $(this).attr('id');
  3. var text = $(this).parent().text();
  4. $(this).parent().replaceWith("<br><span class='form'><input class='text' type='text' value=" + text + "><input class='submit' type=submit value='Изменить'></span>").trigger("focus");
  5. $('.submit').click(function () {
  6. var val = $(this).siblings(".text").val();
  7. $(this).siblings(".text").remove();
  8.  
  9. $(this).replaceWith("<p style='margin: -5px 0px -2px 0px'><a target='_blank' href='thread.php?thread=" + id + "'>" + val + "</a><img style='margin-left: 10px; width: 16px; height: 16px' class='edit' id=" + id + " src='../../pics/Edit.png'></p>");
  10.  
  11. });
  12. });
Runtime error #stdin #stdout #stderr 0.01s 29872KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
prog.js:1:0 ReferenceError: $ is not defined