0

How I can set select text inside iframe body?

Here is my HTML code:

<iframe id="description-frame" class="valid" frameborder="0">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<style>body {background: #FFFFFF;margin: 0px;padding: 0px;text-align:left;font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; font-size: 0.875em;}.desc{color:gray;} body.error { background-color: #EFDBD6;} body.valid { background-color: #F0FFC1; color : #468847; } P {margin-top:0;margin-bottom:0}a{text-decoration: none;color:#000}
</style>
</head>
<body id="rte" class="valid">
Here is my text
</body>
</html>
</iframe>

And jQuery:

$("#description-frame").contents().find('body').select();

but it doesn't work. Where is a problem?

PS. I want do it in my Firefox Extension on some webpage.

Pavlo K
  • 151
  • 9

0 Answers0