javascript - Appending options to a select -
this related adding options select using jquery/javascript has different focus
my problem not able append option-elements select in ie8. when changing engine ie7 in ie's developer-tools work.
it works in ff , chrome.
var valt = "some text"; var charstoignore = 2; var o = new option(valt.slice(charstoignore), valt); $(o).html(valt.slice(charstoignore)); $('#availablepages').append(o);
another method tried:
$('<option/>', {value: valt, text: valt}).appendto("#availablepages");
availablepages
id of select. select not contain elements when page received client. doctype <!doctype html>
.
i tried remove other scripts , css site create sure no side-effects apply.
edit:\ downvoting! it's not fault if provided solutions not work in ie8-versions. since question what work in ie8-versions? is, point of view, understandable not take answers not work me. can see in adding options select using jquery/javascript not 1 whom other replies here not work. using up-/down-vote functionalities channel own mood no wiki/qa-behaviour.
this should trick you:
$('#availablepages').append(new option(valt.slice(charstoignore), valt));
(tested , working in ie8)
javascript jquery html internet-explorer-8
No comments:
Post a Comment