I am trying to get the value of a textarea, to check if it's empty, using Javascript and it doesn't work in Opera. In IE, FF and Chrome it works fine, but in Opera 11 and 10 it reports the value to be the empty string, even if it has text. Here's my code:
if (document.getElementById('mytextareaid').value.replace(/(^\s+|\s+$)/, '') == '') {
alert('empty textarea');
}
Using document.getElementById('mytextareaid').innerHTML instead, doesn't work, either. What am I missing?