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

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -