Показать сообщение отдельно
  #5 (permalink)  
Старый 04.11.2016, 16:52
Аватар для рони
Профессор
Отправить личное сообщение для рони Посмотреть профиль Найти все сообщения от рони
 
Регистрация: 27.05.2010
Сообщений: 33,075

maxapet,
кликнуть по любому input, потом по restore
<!DOCTYPE html>

<html>
<head>
  <title>Untitled</title>
  <meta charset="utf-8">
  <style type="text/css">
  form{
    width: 300px;
    height: 300px;
    border: dashed 2px #FF0000;
  }
  div{
    position: relative;
  }
  div.add{
    height: 1px;
    widows: 100%;
    background-color: #FF0000;
  }

  .add:after {
      content: "restore";
      position: absolute;
       right: -65px;
     top: -23px;

  }

  </style>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
   <script>
$(function() {
   $('div').on('click',function() {
   var html = $(this).html();
   var data = $(this).data('html')||'';
   $(this).html(data).toggleClass('add');
   $(this).data('html', html)
})
});
  </script>
</head>

<body>
<form action="http://">
<div><input name=""></div>
<div><input name=""></div>
<div><input name=""></div>
<div><input name=""></div>
</form>


</body>
</html>
Ответить с цитированием