0
Guys I have this Javascript code below with him I’m trying to get the text selected by the user within an iframe, iframe is with designMode="on" or is it in editable mode, the problem and I’m not able to give the
Alert(string_selected text);
it me returns only the Alert with nothing.
someone can help me since I thank you.
var tag_iframe=document.querySelector('.mine-editor-de-texto');
var conteudo_tag_iframe=tag_iframe.contentDocument || tag_iframe.contentWindow.document;
var texto_selecionado=window.getSelection(conteudo_tag_iframe.body);
var string_texto_selecionado=texto_selecionado.toString();
alert(string_texto_selecionado);
Thanks Douglas Teles most unfortunately did not work the result was the same when giving Alert(string_texto_selected); I returned an empty Alert.
– D.Neves
Post an example of what you’re doing using { }
– Douglas Teles