H I O X INDIA
FREE Javascript
 HOME  ||  Scripts  ||  Purchase  ||  Tutorials  ||  Images  ||  Tools  ||  Templates 
  :-)  Send Page   :-)   Feedback   :-)   Register   :-)   Links   :-)   Support   :-)
Español Français 中文 Deutsch Portuguese Japanese தமிழ்
 Forums   Hosting   Internet Stats   Easy Calculation   FUN Games 

Java Script Source
List All
Date & Time
Calendar
Stop Watch script
Slide Show
Ad Display
Animated Image Effects
Image Effect
Mouse Effects
Color Picker Tool
Dynamic Color
Random Generator
Select All
Form Validation
Formatting Forms
Textbox Counter
Dynamic Form select
Bookmark
Window / User Info
Pagination
Security / Authenticate
Status Bar
Title Bar
Cursor Position
Country List
Calculators
Delete Repeated Values
Alphanumeric
Free Games





Select Div Tag Area - Code


About
Selecting DIV Tag:
You can use this free javascript code to select the contents of Div Tag area just by clicking a button.


Features
a)Just click the button below and select all the contents within Div tag.
b)Press control + C and copy the contents and paste it anywhere.

Code

<!--        Script by hscripts.com          -->
<!--        copyright of HIOX INDIA         -->
<!-- Free javascripts @ http://www.hscripts.com -->
<script type="text/javascript">
function fnSelect(objId)
{
   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();
} 
</script>
<!-- Script by hscripts.com -->
Release Date - 20.6.2007

Get free version without ©copyright link for just 5

For customization of this script or any script development, contact us at support@hscripts.com



Usage
a)Create a div tag area having its id as "testarea", to type the text say 'abcdf' within the div tag.
Ex:-
<div class="copybox" id="testarea">abcdf
b)Create a button with any name and call the function fnSelect(testarea) by using onclick event.
Ex-
<input type="button" value="Copy Code" onClick="fnSelect('testarea')">
c)Now just copy the above free javascript selecting code in to your web pages head tag and test it for selection of contents within div tags.


License
- This javascript (misspelled as java script)/HTML code is given under GPL License
- i.e. Free use for those who use it as it is.
- Free, if your modification does not remove our copyright information and links.
- Detailed License information can be found here
- You can purchase the script if your requirements does not meet GPL License terms.


privacy policy     license     sitemap
© 2004-2010 HIOX INDIA

Others