<img src="images/butAdd.png" onclick="addField(1,1);" />
<div id="divField"></div>
<script type="text/javascript">
function addField(count, type) {
var bid = document.getElementById("bid").value;
$("#divField").append("<a href='#' onClick='javascript:removeField(\"#bow" + bid + "\"); return false;'><img src='images/closeSmall.png' /></a>");
}
function removeField(bid) {
$(bid).remove();
}
</script>
Consider this Javascript code that works fine in Firefox, but not in Internet Explorer.
The function addField()
works, but removeField()
does not.
Any ideas on why this wouldn't work, or any workarounds?