function getIframeSelectionTextSource(tex) { var win = document.getElementById("frame").contentWindow ; var doc = win.document; if (win.getSelection) { if (win.getSelection().toString()!='') { $("#" + tex.id).val(win.getSelection().toString()); return win.getSelection().toString().trim(); } } else if (doc.selection && doc.selection.createRange) { $("#" + tex.id).val(doc.selection.createRange().text); return doc.selection.createRange().text.trim(); } }
$('#'+ "your iframe id").contents().find('#'+"your element id");
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)