error code: object required when giving variables a value

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • GanerDouglas
    New Member
    • Dec 2012
    • 1

    #1

    error code: object required when giving variables a value

    I am recieving the error code: object required when assigning a value to a varible. I am working on a class assignment and code simular to this is used many times in my document and I can't find the problem. Help

    Code:
    >var personalInfo=new Object();
    >personalInfo.firstName;
    >
    >personalInfo.firstName=document.getElementById("firstName").value;
    Last edited by Meetee; Dec 12 '12, 06:27 AM. Reason: Use code tags <code/> around your code
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    worked for me in the console (tried it with a simple string instead of a DOM getter, though).

    Comment

    Working...