I have an HTML table with an input
field in each cell. On focusin
I append a div
(basically a resizable overlay) to the cell.
Jquery code:
$("input").on("focusin", function(){
var selectionDiv = $("<div class='selection-div'><a href='#'></a></div>");
$(this).parent().prepend(selectionDiv);
selectionDiv.resizable();
console.log("focusin");
}).on("focusout", function(){
$(this).prev().remove();
console.log("focusout");
});
The problem comes when I click in the cell. In Chrome the div
is appended and the input
gets the focus. When I click the same cell again, focusout
and focusin
gets called, and the div
is appended again.
However in IE 11, when I click the second time on the same cell, only focusout
is called and the div
is removed. What is causing this behaviour?
I have a jsbin here: http://jsbin.com/tasujuzoqo/1/edit?html,css,js,console,output