html-syntax

R

Rune Runnestø

This code seems to work quite OK:
<HTML><HEAD><TITLE></TITLE></HEAD><BODY>
<FORM ACTION=goodLogin.jsp METHOD=POST>
<BR>User Name:<INPUT TYPE=TEXT NAME=username>
<BR>Password: <INPUT TYPE=TEXT NAME=password>
<BR><INPUT TYPE=SUBMIT VALUE=Submit>
</FORM>
</BODY></HTML>

but I thought it should be written like this:
<HTML><HEAD><TITLE></TITLE></HEAD><BODY>
<FORM ACTION="goodLogin.jsp" METHOD="POST">
<BR>User Name:<INPUT TYPE="TEXT" NAME="username">
<BR>Password: <INPUT TYPE="TEXT" NAME="password">
<BR><INPUT TYPE="SUBMIT" VALUE="Submit">
</FORM>
</BODY></HTML>

Is the one way with the "..." more recommended than the other way without ?

Regards
Rune
 
O

Oli Filth

Rune said:
This code seems to work quite OK:
<HTML><HEAD><TITLE></TITLE></HEAD><BODY>
<FORM ACTION=goodLogin.jsp METHOD=POST>
<BR>User Name:<INPUT TYPE=TEXT NAME=username>
<BR>Password: <INPUT TYPE=TEXT NAME=password>
<BR><INPUT TYPE=SUBMIT VALUE=Submit>
</FORM>
</BODY></HTML>

but I thought it should be written like this:
<HTML><HEAD><TITLE></TITLE></HEAD><BODY>
<FORM ACTION="goodLogin.jsp" METHOD="POST">
<BR>User Name:<INPUT TYPE="TEXT" NAME="username">
<BR>Password: <INPUT TYPE="TEXT" NAME="password">
<BR><INPUT TYPE="SUBMIT" VALUE="Submit">
</FORM>
</BODY></HTML>

Is the one way with the "..." more recommended than the other way without ?

http://www.w3.org/TR/html4/intro/sgmltut.html#h-3.2.2
 
A

Andy Dingley

Is the one way with the "..." more recommended than the other way without ?

Yes.

You don't always need the quotes. But it's never bad to use them, and
sometimes you _must_ use them (depending on the content inside them).
For XML or XHTML work, they're always needed, so putting them in is a
good habit to get into anyway.

I suggest you take a read of the W3C website and the original HTML
specifications.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,905
Latest member
Kristy_Poole

Latest Threads

Top