Check user clicked on iframe
//1
$('#filecontainer').load(function(){
var iframe = $('#filecontainer').contents();
iframe.find("#choose_pics").click(function(){
alert("test");
});
});
//2
window.addEventListener('blur', function(e){
if(document.activeElement == document.getElementById('Your iframe id'))
{
console.log('iframe click!');
}
});
//3
$(document).ready(function(){
$("iframe").load(function(){
$(this).contents().on("mousedown, mouseup, click", function(){
alert("Click detected inside iframe.");
});
});
});