Select Embed Code Script

Simple script which allows you to select embed code or particular text area content using Javascript.

Features

  • Just click the "select code" button to select the entire code.
  • It provides you to quickly select tags, text area, iframe and embed codes.
  • It is user-friendly and time-saver.
  • Works on almost all modern browsers.

Preview

  • This is the Preview content for this script.
  • Click Select code button in preview.
  • Now the div cotent should be selected.

Downloads

Javascript Code


<!--Script by hscripts.com-->
<!-- Free javascripts @ https://www.hscripts.com -->
<style>
.tabstyle{
font-family: Monaco, Verdana, Sans-serif;
font-size:12px;
background-color: #f9f9f9;
border: 1px solid #D0D0D0;
color: #002166;
-moz-border-radius:10px;
-webkit-border-radius:10px;border-radius:10px;
width:60%;
}
.tabstyle ul li{text-align: left;
}.button
{
background:url(https://www.hscripts.com/scripts/JavaScript/select_code.jpg); width:80px; height:20px; border:0;
font-size:11px; font-weight:bold;
padding:0px;color:#ffffff;}

</style>
<script type='text/javascript'>
/*** Function for select the code ***/
function fnSelect(objId)
{var sds = document.getElementById("dum");if(sds == null){
alert("You are using a free package.\n You are not allowed to remove the tag.\n");}var sdss = document.getElementById("dumdiv");if(sdss == null){alert("You are using a free package.\n You are not allowed to remove the tag.\n");}
if(sds != null){fnDeSelect();if (document.selection)
{var range = document.body.createTextRange();
range.moveToElementText(document.getElementById(objId));
range.select();}else if (window.getSelection)
{var range = document.createRange();
range.selectNode(document.getElementById(objId));
window.getSelection().addRange(range);}
}
}
function fnDeSelect()
{if (document.selection)
document.selection.empty();else if (window.getSelection)
window.getSelection().removeAllRanges();
}
/*** Function for select the code ***/
</script>
<!-- Script by hscripts.com -->


HTML Code


<!--Script by hscripts.com-->
<!-- Free javascripts @ https://www.hscripts.com -->
<!-- Script by hscripts.com -->
<html>
<head><title>Select Embed Code Script</title>
</head>
<body><div align='center'>
<h3>Select All Code / Area Script using Javascript </h3>
<div class='tabstyle' id='pselect-code' >
<ul>
<li>This is the Preview content for this select code script.</li>
<li>Click Select code button in preview.</li>
<li>Now the div cotent should be selected.</li>
</ul>
</div><br />
<input type="button" value="Select Code" class='button' onClick="fnSelect('pselect-code')" >
<div style="font-size:11px;" id="dumdiv" align="center">©<a href="https://www.hscripts.com" style="color: #3D366F;
font-size:11px; text-decoration:none;" id="dum" >h</a></div>
</div>
</div>
</body>
</html>

  • Release Date - 07-04-2008
  • Get free version without ©copyright link for just $10/-
  • For customization of this script or any script development, mail to support@hscripts.com

Usage

  • Copy and Paste the HTML code given above, save it with .html extension.
  • Just copy javascript code and paste it in <head> section of HTML.
  • Run the file in any Modern browsers, to have your own select code script.

License

Related Scripts

Free Javascript Scripts


Ask Questions

Ask Question