1. Login pada blog sobat
2. Rancangan
3. Tambah Gadget
4. HTML / Javascript
5. Copy paste kode dibawah ini
<script type="text/javascript">6. Simpan dan lihat hasilnya
function disableSelection(target){
if (typeof target.onselectstart!="undefined") //IE route
target.onselectstart=function(){return false}
else if (typeof target.style.MozUserSelect!="undefined") //Firefox route
target.style.MozUserSelect="none"
else //All other route (ie: Opera)
target.onmousedown=function(){return false}
target.style.cursor = "default"
}
disableSelection(document.body)
disableSelection(document.getElementById("mydiv"))
//Sample usages
//Disable text selection on entire body
// //Disable text selection on element with id="mydiv"
</script>
<body oncontextmenu="return false;">
<body document.onselectstart="return false">
Selamat Mencoba!!!
Tidak ada komentar:
Posting Komentar