When we create a tag in HTML we can assign values to its properties, however, the property id
and name
, I realize that are often used and usually the values that are assigned to them are the same, see the example below:
<!DOCTYPE HTML>
<html lang="pt-br">
<head>
<meta charset="UTF-8" />
<title>Exemplo para ilustração.</title>
</head>
<body>
<p size=2>O <spam style="font-weight:bolder;">input text</spam> esta com as propriedades id e name definidas com o mesmo valor<br> que é "nome".</p>
<label for="nome">Nome:</label><br>
<input type="text" name="nome" id="nome" size=25 />
</body>
</html>
What is the purpose of these two properties id
and name
and if there is any difference in relation to each other, since both have the same value?