Javascript reserved words

less than 1 minute read

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

<script language="javascript">

    function clear()

<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.



Leave a Comment