Атрибут name

Описание

Указывается имя формы.

Синтаксис

<form name='текст'>...</form>

Пример

<!DOCTYPE html>
<html lang='ru'>
<head>
<meta charset='UTF-8'>
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
<title>Document</title>
</head>
<body>
<script>
function f(){
alert('Привет, ' + document.forms['data-test'].inputik.value + '!')
}
</script>
<form name='data-test'>
<input type='text' name='inputik' placeholder='Имя'/>
<button type='button' onclick='f()'>Отправить</button>
</form>
</body>
</html>