¿Cómo cambiar el siguiente código para FireFox a IE?
En FireFox funciona bien pero en Internet Explorer=No.
Código PHP:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<title> ComboBox </title>
<style type='text/css'>
select#language
{
background-repeat: no-repeat;
background-position: 2px 4px;
padding-left: 20px;
}
select#language option
{
background-repeat: no-repeat;
background-position: 2px 2px;
padding-left: 24px;
}
</style>
<script type='text/javascript'>
window.onload = function()
{
/**
* arrangement with the images
*/
flags = new Array(3);
flags[0] = 'url(mx.png)';
flags[1] = 'url(gb.png)';
flags[2] = 'url(fr.png)';
/**
* we obtain the I combo
*/
comboLanguage = document.getElementById('language');
/**
*We assign the initial image of the combo
*/
comboLanguage.style.backgroundImage = flags[0];
/**
* we assign the images to the elements of the combo
*/
for (i = 0; i < 3; i++)
{
comboLanguage.options[i].style.backgroundImage = flags[i];
}
/**
* event onchange of the combo
*
* when it changes the selected element, we change the image of the combo
*/
comboLanguage.onchange = function()
{
index = comboLanguage.options.selectedIndex;
comboLanguage.style.backgroundImage = flags[index];
}
}
</script>
</head>
<body>
<select id='language'>
<option value='1' id='esp'>Spanish
<option value='2' id='ing'>English
<option value='3' id='fra'>French
</select>
</body>
</html>
Saludos