<html>
<body>
<script type="text/javascript">
function smth() {
if (document.getSelection) {
var str = document.getSelection();
if (window.RegExp) {
var regstr = unescape("%20%20%20%20%20");
var regexp = new RegExp(regstr, "g");
str = str.replace(regexp, "");
}
} else if (document.selection && document.selection.createRange) {
var range = document.selection.createRange();
var str = range.text;
}
alert(str);
}
</script>
<iframe id="my" width="300" height="225">
.....some html ....
</iframe>
<a href="#" onclick="smth();">AA</a>
</body>
</html>
with smth function i can get selected text from some div, but it doesnt work with iframe. any ideas how to get selected text from iframe ? thanks