Is it any point to use html directly instead of label

  • Thread starter Thread starter Tony Johansson
  • Start date Start date
T

Tony Johansson

Hello!

Instead of using a label control I can write the text directly in the web
page.

So is it any point to write text directly insted of using a label ?

//Tony
 
Tony Johansson said:
Hello!

Instead of using a label control I can write the text directly in the web
page.

So is it any point to write text directly insted of using a label ?

If the text never changes then you could use static text in the HTML, but if
the text does change then with a label:

1. its considerably easier to use than injecting plain text.

2. ots probably much easier for someone else (or you) to maintain the code
if you use a label rather than adding output directly.

whether or not the text every changes:

3. You can associate a label with another control, which helps screen
readers associate the text (caption) with the control it goes with.

Hope this helps.
 
Back
Top