+ 6
What happens if we'll not use name attributes???
<form> <input type="text" name="username" /><br /> <input type="password" name="password" /> </form> . Suppose we'll not use here name attribute. Does it effect the output and if so then how? Please help🙏🙏🙏🙏🙏
2 odpowiedzi
+ 5
It doesn't effect the output but it does effect further processing. Since you have created a form, the data entered by the user is what you want and so you would like to access it in the server side. The "name" attribute helps you to recognize which info entered in the form you want to access.
Like, if anyone want to call you, they identify you by your name, so similarly the case here.
+ 4
the name attribute is what permits to identify the input and its data when working with a server side language. for instance, in PHP, you would have access to $_POST["username"] superglobal that you can process and do whatsoever you want with it. Otherwise, from an HTML perspective, it will not affect anything related to the display. puting it or not is therefore indifferent.