GoldPage1

logo

Tin đề xuất

Sự kiện tiêu biểu

Select (and copy) Form Element Script

(Blogtamsu) - NGhĩa là bạn tạo phần sellect all trong bài viết của mình Chèn code sau vào thẻ <head> <style> .highlighttext{ background-color:....

https://nhipsong24vn.blogspot.com/ - Chuyên nhận rip, thiết kế, cung cấp: Template blogspot, template blogger chuẩn SEO, Tối ưu website, tích hợp tin tức, giỏ hàng cho blogger bán hàng...

NGhĩa là bạn tạo phần sellect all trong bài viết của mình
Chèn code sau vào thẻ <head>

<style>
.highlighttext{
background-color:yellow;
font-weight:bold;
}
</style>

<script language="Javascript">
<!--

/*
Select and Copy form element script- By Dynamicdrive.com
For full source, Terms of service, and 100s DTHML scripts
Visit http://www.dynamicdrive.com
*/

//specify whether contents should be auto copied to clipboard (memory)
//Applies only to IE 4+
//0=no, 1=yes
var copytoclip=1

function HighlightAll(theField) {
var tempval=eval("document."+theField)
tempval.focus()
tempval.select()
if (document.all&&copytoclip==1){
therange=tempval.createTextRange()
therange.execCommand("Copy")
window.status="Contents highlighted and copied to clipboard!"
setTimeout("window.status=''",1800)
}
}
//-->
</script>

Sau đó cho đoạn code sau vào thẻ <BODY>

<form name="test">
<a class="highlighttext" href="javascript:HighlightAll('test.select1')">Select All</a><br>
<textarea name="select1" rows=10 cols=35 >This is some text. This is some text. This is some text. This is some text.</textarea>
</form>

Chúc bạn thành công
Nguồn

Xem thêm>>

Xem thêm>>

Đóng liên hệ [x]
hotline0918