Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

this question may sound stupid, but no one has ever taught me this. I have an HTML input for a password field, and you can only log on with one specific password with JS. Could someone please give me a syntax on assigning a variable to document.getElementById(""); syntax or a different syntax? Thanks.

share|improve this question

closed as not a real question by MainMa, Matthieu, GrandmasterB, gnat, Jim G. Sep 17 '12 at 20:40

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

I think you would be better asking these types of questions on stackoverflow. This site is for more subjective questions about programming, not specific language features. – GrandmasterB Sep 15 '12 at 17:18
up vote 2 down vote accepted

I guess you are trying to use password in your page. If the purpose of registration is to confirm that the person exists and has supplied a valid email address then at the first instance you should email them a random password rather than having them choose their own and use it immediately.

Here is a good article that walks you through JavaScript: Password Validation using regular expressions and HTML5.

In addition you may get a wealth of information about HTML DOM Password Object here.

share|improve this answer
Thank you, I had a lot of confusion. – Coding Seahawks Sep 15 '12 at 16:36
I just did! I recently gained that advantage! – Coding Seahawks Sep 15 '12 at 16:45
Sure, what were they titled? – Coding Seahawks Sep 15 '12 at 16:54
@CodingSeahawks, thx, they all titled as HTML5 questions that you have asked today. look at your Questions list - – Yusubov Sep 15 '12 at 17:01
I just did that. But you did not answer 1 html5 question. :) – Coding Seahawks Sep 15 '12 at 17:04

Not the answer you're looking for? Browse other questions tagged or ask your own question.