Modify ↓
Ticket #1074 (closed bug: fixed)
$.html(val) can not be used to Select Element
| Reported by: | clmm | Owned by: | john |
|---|---|---|---|
| Priority: | major | Milestone: | 1.2.2 |
| Component: | core | Version: | 1.1.3 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description (last modified by john) (diff)
var optionStr = "<option value="-1" '''selected="selected"'''>é¸æŠž</option>";
jQuery.each(fileNameArr,function(i,n){
optionStr += "<option value=""+i+"">"+n+"</option>";
});
The option which value is "-1" will be selected as suppose. But $.html(val) look like no useless to this.
correct: document.getElementById('search-type').innerHTML = optionStr; correct: jQuery("#search-type").get(0).innerHTML = optionStr; wrong: jQuery("#search-type").html(optionStr);
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.
