17 April 2013
0

<script type='text/javascript'>
function autoSelect(elem) {
    var selection, range;
    if (window.getSelection) {
        selection = window.getSelection();
        range = document.createRange();
        range.selectNodeContents(elem);
        selection.removeAllRanges();
        selection.addRange(range);
    } else if (document.selection) { // IE
        selection = document.selection.createRange().text;
        range = document.body.createTextRange();
        range.moveToElementText(elem);
        range.select();
    }
}
</script>
<script type='text/javascript'>
// Eksekusi di sini
$('pre').on("click", function() {
    autoSelect(this);
});
</script>
Sumber : www.dte.web.id

0 comments:

Posting Komentar