properties - Javascript - Cannot set property 'value' of undefined -


I am creating a JavaScript cycle, which can be kept in the program instead of typing

Documents. (A_ to z _) value = (zx from ax);

My job is yet to:

  function absolute () {var counter 2 = "ax bx cx dx fx gx hx ix jx kx lx mx nx (Var i = 0; i <26; i ++) {counter 2 [i] for bp px qux rx sx tx ux vx vx xx yx jacks ""; var alph2 = counter2.split (""); = 1;} Var letters2 = ".a_ .b_.cc_ .d_ .e_ .f_ .g_ .h_ .i_ .j_ .k_ .l_ .m_ .n_ .o_ .p_ .q_ .r_ .s_ .t_ .u_ .v_. W x y z_ "; var let2 = letters2.split (" "); var entry = document.getElementById (" entry ");. Document.entry [let2 [i]] value = alph2 [i];}   

But chrome apparently does not like the other from the previous row, by saying that can not determine undefined value - and "entry" is a form of HTML.

I am starting a JavaScript, so thank you very much for your patience: -)

  counter 2 [i] = 1;    

What is this to do? Counter is a primitive string, so it will have no effect.

 < code> entry. (a_ to z _). value let2 = [".a_ If you are using bracket notation, then you have to leave the dot. From dot notation property access it should only be the property name in the array:  
  let2 = ["a_", "b_", a ?? |]   

In addition, you are not looping on the let2 array, but reaching the value of i in the bus - Where i is the value of 26 still wrap around the loop.


In addition, you can easily generate letters easily, you do not need to list the entire alphabet in the string or the array. Better: var els = document.forms.entry.elements; {Var chr = String.fromCharCode (97 + i), alph = chr + "x", lett = chr + "_" for (var i = 0; i & lt; 26; i ++); If (Els [Late]] = Faucet) Els [Late]. Original = alpha; }

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -