उपरोक्त कोड में, नाम विशेषता गायब है (बोल्ड लाइन)। नाम विशेषता का उपयोग न करने का क्या असर होगा ?
In the above code, the name attribute is missing (bold line ). What will be the effect of not using the name attribute ?
<!DOCTYPE html>
<html>
<body>
<h2>The name Attribute</h2>
<form method = “get”>
First name:<br> <input type="text" value="Shivansh"> <br>
Last name:<br> <input type="text" name="lastname" value="kumar"> <br>
<input type="submit" value="Submit">
</form>
</body>
</html>
A)
B)
C)
D)
Explanation:
In the given code, the name
attribute is missing from the first input field (for the first name).
The name
attribute is important in a form because it determines the key that is sent to the server along with the value of the input field. Without the name
attribute, the value of that input field will not be submitted when the form is sent.
So, the correct answer is:
(A) Value of that input field will not be submitted.