Javascript reserved words

less than 1 minute read

i had trouble all day with this simple piece of javascript.

<script language="javascript">

    function clear()
    {
        alert("clear");
    }
</script>

<input type="button" value="clear" onClick="clear()"/>

it seems 'clear' is a key work in javascript. renaming the function to clearThis works.

I found this site which gives a list of reserved works, but 'clear' does not appear in the list.

http://www.webdevelopersnotes.com/tutorials/javascript/reserved.php3





http://www.codingforums.com/showthread.php?t=19947

Categories:

Updated:

Leave a Comment