Problem
The following scripts do exactly what I require, in all browsers tested except IE8, where it removes the button without replacing it with anything.
Background
I have been working on a method to replace submit type inputs with image type inputs using jQuery.
First, I had this following which works with FF and webkit:
marker = jQuery('<span class="marker"></span>').insertBefore('input#SearchButton');
jQuery('input#SearchButton').detach().attr('type', 'image').attr('src',theme_folder+'/style/images/search_button.png').insertAfter(marker);
marker.remove();
But this fails in all 6+ versions if IE (it removes the button, but doesn't replace with image), so I developed the following script for IE browsers:
marker = jQuery('<span class="marker"></span>').insertBefore('input#SearchButton');
new_search = jQuery('<input id="SearchButton" value="Search" name="Searchbutton" type="image" src="'+theme_folder+'/style/images/search_button.png'+'" />')
jQuery(new_search).insertAfter('input#SearchButton');
jQuery('input#SearchButton').remove();
marker.remove();
I am using HTML Conditionals to filter the flow of traffic to the appropriate script, so so the whole thing looks like this:
<!--[if IE]>
<script>
marker = jQuery('<span class="marker"></span>').insertBefore('input#SearchButton');
new_search = jQuery('<input id="SearchButton" value="Search" name="Searchbutton" type="image" src="'+theme_folder+'/style/images/search_button.png'+'" />')
jQuery(new_search).insertAfter('input#SearchButton');
jQuery('input#SearchButton').remove();
marker.remove();
</script>
<![endif]-->
<![if !IE]>
<script>
marker = jQuery('<span class="marker"></span>').insertBefore('input#SearchButton');
jQuery('input#SearchButton').detach().attr('type', 'image').attr('src',theme_folder+'/style/images/search_button.png').insertAfter(marker);
marker.remove();
</script>
<![endif]>