In the code below if the the text box is in focus then redDiv appears.
if the redDiv or its children are in focus then it must stay visible and only hide when it looses focus. Can you please help?
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="jquery-1.8.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
var onetxt = $('<input type="text" />');
var Input1 = $('<input type="text" />');
var redDiv = $('<div>', { tabindex: "5", style: "width:200px;height:200px;background:red; display:none;", text: 'test', html:"<br /><br />" }).append(Input1);
onetxt.focusin(function () {
redDiv.show();
});
Input1.focusin(function () {
redDiv.show();
});
redDiv.focusin(function () {
redDiv.show();
});
onetxt.blur(function () {
redDiv.hide();
});
$('#myarea').after(onetxt,redDiv);
});
</script>
</head>
<body>
<div id="myarea"></div>
</body>
</html>