onmousedown IE8 not working
I have created something like this
<textarea id='txtarea'>Dear Sir/Madam
Sincerely,
[Your Name]
</textarea><br/><input id="btn" value='Add Date' type="button"/>
<script>
var textarea=document.getElementById('txtarea'),pos=0
textarea.focus()
document.getElementById('btn').onclick=addDate
document.getElementById('btn').onmousedown=function(){return false}
function addDate(){
textarea.innerHTML+="\n"+new Date().toUTCString()
}
</script>
All of this this code works fine on all browser except IE 8 and lower...
the problem is:
When the textarea is focused and user clicks Add Date button the textarea
doesn't need to be deselected (onmousedown=function(){return false}). In
IE 8 and lower it gets deselected (I think the return false is not
working).
What to do to support IE 8 and lower.
Jsfiddle
No comments:
Post a Comment