peps03
asked on
Parse error in simple jquery code
Hi,
As you can see below in the code, i get a parse error.
The script works in chrome not in safari. (which i think is strange because they both use webkit)
What is wrong with the code and how can i fix it?
Thanks!
As you can see below in the code, i get a parse error.
The script works in chrome not in safari. (which i think is strange because they both use webkit)
What is wrong with the code and how can i fix it?
Thanks!
<script>
function class() {
contact.php:31SyntaxError: Parse error
if ($('#55').hasClass('buttonactive'))
{$('#55').removeClass('buttonactive').addClass('button');}
else
{$('#55').removeClass('button').addClass('buttonactive');}
}
</script>
ASKER
thanks.
i changed it to, but still get the error:
i changed it to, but still get the error:
<script>
function class() {
contact.php:31SyntaxError: Parse error
if ($('#a55').hasClass('buttonactive'))
{$('#a55').removeClass('buttonactive').addClass('button');}
else
{$('#a55').removeClass('button').addClass('buttonactive');}
}
</script>
use an other function name else, post the php script
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
se last post
currently you're using only numbers
Check Attribute Values here for example to know the rules :
http://www.w3schools.com/tags/att_standard_id.asp