removeAttr( имя )

« Обратно к странице атрибутов

removeAttr( имя )

Удаляет указанный атрибут из каждого совпавшего элемента.
Аргументы:

имя Строка
Имя свойства, которое необходимо удалить.
Примеры:
Нажимая на кнопку, Вы активируете элемент ввода рядом с ней.

    $("button").click(function () {
      $(this).next().removeAttr("disabled")
             .focus()
             .val("editable now");
    });
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                    "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <script src="http://code.jquery.com/jquery-latest.js"></script>

  <script>
  $(document).ready(function(){

    $("button").click(function () {
      $(this).next().removeAttr("disabled")
             .focus()
             .val("editable now");
    });

  });
  </script>

</head>
<body>
  <button>Enable</button>
  <input type="text" disabled="disabled" value="can't edit this" />

</body>
</html>
Name Type