javascript - jquery created dropdown not displaying in ie8 -


I have a code that creates a dropdown list but in IE8 the dropdown has the correct number of entries but the text is empty, they are the right values. I can not see what is missing?
  if (max_ch> 0) {var newDiv = $ ('& lt; div & gt; cell' + (i + 1) + '& lt; select class = "Adu" name = "Data [rate] ['+ r_id +'] ['+ ro_id +'] [adult] []" & gt; & lt; / select & gt; adult. & Lt; class = "chi" name = " Data [rate] ['+ R_id +'] ['+ ro_id +'] [child] [] ">  children. ;); NewDiv.attr ("id", "residents" + i) .appendTo (showdiv + '.rooms_adults'); Var roomPrice = $ ('& lt; input type = "hidden" name = "data [rate] [' + r_id + '] [' ro_id + '] [value] []" value = "' + room_b + '"/>'); RoomPrice.attr ("id", "roompres" + i) .appendTo (showdiv + '.rooms_adults'); Var num_opts = number (max_ad) +1; (Ad = 0; Ad & lt; num_opts; Ads ++) {$ (Shodiv + '# Residents' + i + 'select.adu') Enclosure (new option (advertisement, advertisement)); } Var num_opts = number (max_ch) +1; (Ch = 0; ch & lt; num_opts; ch ++) {$ (showdiv + '# resident' + i + 'select.chi'). Attachments (new option (ch, ch)); } $ (Shodiv + '#' + '+ i +' select.adu '). Val ('1'); } <{ 
"post-text" itemprop = "text">

You can either use it

  Num_opts = number (max_ad) + 1, slc_adu = $ (showdiv + '#points' + i + 'select.adu'); (Ad = 0; ad & lt; num_opts; ad ++) {slc_adu.append ("option value =" "+ +" + "\" & gt; "+ ad +" & lt; / option & Gt; "); }   

or

  var num_opts = number (max_ad) + 1, slc_adu = $ (showdiv + '#' + '+ i +' select. Adu '), option = slc_adu.attr ("options"); {Option [options.length] = new option (advertisement, advertisement) for (ad = 0; ad & lt; num_opts; ad ++); }   

Otherwise the IE will show associated text values ​​for the option.

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -