Javascript copy text script not working properly? -
Javascript copy text script not working properly? -
i have javascript copying text reason isn't working , life of me can't figure out what!
<script> function copytext(field) { var selectedtext = document.selection; if (selectedtext.type = 'text') { var newrange = selectedtext.createrange(); field.focus(); field.value = newrange.text; } else { alert('select text in page , press button'); } } </script>
if (selectedtext.type = 'text') {
should be
if (selectedtext.type == 'text') {
= setting
== comparing
javascript
Comments
Post a Comment