I have a script as follows where element is a number:
function updateList(element) {
var out_list = "<Select name='item" + element + "' onchange=getQualType(this.value, 'qualType" + element + "')>";
.... add options here ...
out_list += "</Select>"
document.getElementById('dropdown_list' + element).innerHTML = out_list;
}
However what is in the browser is:
<select name="item40" onchange="getQualType(this.value," 'qualtype40')="">
</script>
Can anyone point out what is causing the incorrect quotes in the output?
UPDATE
Spotted it:
var out_list = "<Select name='item" + element + "' onchange=getQualType(this.value, 'qualType" + element + "')'>";
Single quote after bracket - thanks all.
selectit's output, per se. Its writing out yourselectelement literally (and thus, correctly). Your string that creates it is technically the issue. You could just create a handler for theselectthrough JS, and handle theonchangeevent that way, instead :)'qualType" + element + "'