hi, all
i have a problem with appending options from object to select element
i append options but it shows empty in the select list
here is my script
[code=php]<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01//EN”
“http://www.w3.org/TR/html4/strict.dtd”
>
<html lang=”en”>
<head>
<title><!– Insert your title here –></title>
<script>
var mehsullar = [
{ name:’MotherBoard ASUS’, value:’MotherBoard ASUS’, option:null },
{ name:’MotherBoard Gigabyte’, value:’MotherBoard Gigabyte’, option:null },
{ name:’MotherBoard MSI’, value:’MotherBoard MSI’, option:null },
{ name:’Graphiqcard ASUS’, value:’Graphiqcard ASUS’, option:null },
{ name:’GraphigCard ATI’, value:’GraphigCard ATI’, option:null },
{ name:’GraphigCard GefORCE’, value:’GraphigCard GefORCE’, option:null }
];
mehsullar.artim=function(menu)
{
this.menu=menu;
// this.cedvel=cedvel;
for(var i=0;i<this.length;i++){
this[i].option=document.createElement(‘option’);
this[i].option.name=this[i].name;
this[i].option.value=this[i].value;
this.menu.appendChild(this[i].option);
}
alert(this.length)
}
onload = function() {
var menu=document.getElementById(‘siyahi’);
mehsullar.artim(menu);
}
</script>
</head>
<body>
<form name=”prod”>
<table><tr><td>say</td><td>
<select id=”siyahi”><option value=””>fhfdh fh fh</option></select></td></tr>
</form>
</body>
</html>
thanks in advance for attention