I have a page that uses jQuery to construct links and anchor tags based on existing HTML elements. It works in all browsers I tested except IE, where the output for the anchor tag was a little different.
Other browsers:
<a class="courseshortcut" name="TitleJanuary12-13,2013"></a>
Internet Explorer:
<a name="TitleJanuary12-13,2013" class="courseshortcut"/>
The generated links to these anchor tags look like this:
<a href="#TitleJanuary12-13,2013">January 12-13, 2013 - Miami, FL</a>
The following section of code in the document.ready function adds the anchors:
//adds the anchor tags
$('.courseentry').each(function() {
var str = $(this).find('.coursetitle').html() + $(this).find('.coursedate').html();
$(this).prepend("<a class='courseshortcut' name='" + str.replace(/\s+/g, '') + "'></a>");
});
I can't figure out why this issue is occurring. Can someone enlighten me? A more complete version of the test script can be found here.
` tags in a row, you should possibly rethink your solution. – aquinas Feb 11 '13 at 23:20