Skip to main content

Bug Tracker

Side navigation

#1074 closed bug (fixed)

Opened March 27, 2007 06:00AM UTC

Closed November 17, 2007 10:14PM UTC

$.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:
Blocked by: Blocking:
Description
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);

Attachments (0)
Change History (2)

Changed July 21, 2007 01:47PM UTC by john comment:1

description: {{{\ 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);\ \ \ \ {{{ \ 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); \ \ \ \
milestone: 1.1.31.1.4
owner: → john
version: 1.1.21.1.3

Changed November 17, 2007 10:14PM UTC by davidserduke comment:2

milestone: 1.1.41.2.2
resolution: → fixed
status: newclosed

Fixed in [3844].