Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

165
Views
Should I use the label in the product register form?

question picture Click !!✔

input & label
I know the reason for using it is because of the dependency. Is it correct to write the above photo in this label & input ???

I am working on the product registration page

<label>
  {label && <span>address</span>}
  <input type={type} placeholder={placeholder} /> 
</label>

I think it should be written in span & input ex)

<div>
 {label && <span>address</span>}
<input type={type} placeholder={placeholder} />
<div>
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Semantically you want the label to reference the input, or rather, for the input to gain focus by interacting with the label. This is done for accessibility.

You get this behavior by default when wrapping an input with a label element. This is correct.

<label>
  {label && <span>address</span>}
  <input type={type} placeholder={placeholder} /> 
</label>

The second is not technically correct semantic HTML since you are rendering what is effectively a label but not coding it as such.

If the issue is that label elements are inline and you want the block display of a div then either apply CSS to your label elements or wrap both the label and input in a div.

about 4 years ago · Juan Pablo Isaza Report

0

Having a label wrapped around the input allows you to click on the label and focus the input. Its especially useful when having to click radio buttons.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!