I’m searching to select a text from a div, then click on a bookmarklet that remove all html parts in the body except the div where the text is selected
maybe jquery can help with something like :
javascript:var%20s=document.createElement('script');s.setAttribute('src',%20'http://jquery.com/src/jquery-latest.js');document.body.appendChild(s);s.onload=function(){/*the code*/};void(s);
Assuming the text you selected appears exactly once on the page this should work. If it appears multiple times this should show the last div on the page which contains the selected text.
More readable
As one-liner
If you also want the css stylings to be gone you must empty the
<head>too