Jump to content

Cms Page, Not Accept "onclic" In Link


Recommended Posts

Hello!

 

I'm new in this forum.

 

I have a problem with the cms page.

 

I would that:

 

when click link, change the color or background for another div in the page.  

 

 for clik in link and call a function javascript

 

Put this code:

<a class="gir" href="#xxxx" onclick="canvicolor('contgir')" >xxxxx</a>

 

But at save, the code like this:

 

<a class="gir" href="#xxxx" >xxxxx</a>

 

delete  onclick="canvicolor('contgir')"

 

Why?¿

 

 

add code javascript in cms.tpl

 

function canvicolor(id) 
var element;
element = document.getElementById(id); 
element.style.color= #FF0000; 
}
 

 

thanks

 

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...