|
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.
|