javascript - Why does the input text fields not appear -


i'm debugging bigger system, have tried take out parts think posing problems.

i can't quite see why input text fields aren't appended html in this jsfiddle.

the js code:

 (var counter = 0; counter < 20; counter++) {      var anbox = $(document.createelement('input')).attr({         type: 'text',         class: 'anbox',         size: '1',         maxlength: '1'     });     anbox.appendto('#answerline_' + i);}; 

yeah, minor. there no i variable defined, should counter instead:

anbox.appendto('#answerline_' + counter); 

in order search such problems suggest use debugging tools chorme developer console or firebug.

demo: http://jsfiddle.net/qygb2/106/


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -