onclick() and onblur() never work in IE8

3.2k Views Asked by At

I'm using javacsript functions onclick and onblur on text area they are working fine in Firefox but never work in IE8. I need to call javascript function to be called on every key press. What is the solution?

<textarea name="txtClassifiedText" rows="5" cols="40" id="txtClassifiedText" onblur="recalc()" onkeypress="recalc()" onclick="this.value='';">Enter your classified text here (MAX 40 words)*</textarea>

<script>function recalc() {
        alert('hi');
    }</script>

There's no javascript error in IE8 or FF

1

There are 1 best solutions below

2
On BEST ANSWER

I believe "recalc" might be a protected word. Rename your function something like "booger" and retest. Good luck!

See here: http://msdn.microsoft.com/en-us/library/ms537634(v=vs.85).aspx

The recalc method allows authors to explicitly cause the values of dynamic properties to be updated.