I have
<div id="edit-country-wrapper">
<select id="edit-country" class="form-select" name="country">
<option selected="selected" value="all">All</option>
<option value="canada">Canada</option>
<option value="usa">USA</option>
</select>
</div>
And want to change it to
<div id="edit-country-wrapper">
<ul id="edit-country" class="form-select" name="country">
<li><a class="selected" href="/all">All</a></li>
<li><a class="" href="/canada">Canada</a></li>
<li><a class="" href="/usa">USA</a></li>
</ul>
</div>
This is what I have right now.
$(document).ready(function() {
$('#edit-country-wrapper select').each(function() {
var $select = $('<div id="location-select" />');
$(this).find('option').each(function() {
var $option = $('<a />');
$option.attr({
href: '?country=' +$(this).attr('value'),
id: 'location-' + $(this).attr('value'),
class: $(this).attr('selected'),
html: $(this).html()
});
$select.append($option);
});
$(this).replaceWith($select);
});
});
I'm trying to replace a dropdown list with an unordered list. I have it working in FF & Chrome but not in IE. Please Help!!