Thực hiện
Để thêm tiện ích này vào blog bạn thêm javascript bên dưới vào template của mình trước thẻ </body> sau đó lưu lại template<script type='text/javascript'> var pres = document.getElementsByTagName("pre"); for (var i = 0; i < pres.length; i++) { pres[i].addEventListener("dblclick", function () { var selection = getSelection(); var range = document.createRange(); range.selectNodeContents(this); selection.removeAllRanges(); selection.addRange(range); }, false); } </script>
Chúc bạn thành công!
Copy to clipboard