i want use focusout on textarea, stash value of clicked button caused focusout, , click later, after processing. solution works on devices except iphone , ipads. can explain why event.relatedtarget null on touch screens? or browser? else there use?
i have tried e.currenttarget , document.activeelement (returns whole html body) trying settimeout around use of e.currenttarget. can't seem id of clicked button inside focusout, on ipads , iphones.
here's sample:
<div id="resultpage"> <textarea id="txtanswer0" class="txtanswer"></textarea> <button id="gonow"> go </button> </div> $(document).ready(function() { $("#resultpage").on("focusout", ".txtanswer:not(input[type=radio], input[type=checkbox])", function(e) { var targetctrl = e.relatedtarget; alert(targetctrl); });
});
here fiddle:
in research learned relatedtarget
supposed on mouse events. if relatedtarget
isn't null in non-mouse event browser isn't following standards.
you'll have temporarily store button, and/or button value in variable on click can used later second click.
Comments
Post a Comment