2
How do I make the user click on a particular link, change the CSS and title? For example:
I have this link: Contraste
When you click on it, change the CSS and the link name too, passing to Sem contraste
.
I started doing something, but Jquery is not my strong suit. Look below:
<a href="#" id="contraste" class="ativar" style="font-weight: bold" accesskey="c" title="Contraste ALT + c">Contraste (c)</a>
$('#contraste').click(function(){
var acao = $(this.className);
if(acao === "ativar"){
// Alterar o CSS
}else{
// Voltar para o CSS atual
}
});
Are you using any backend programming in your code? It would be easier if you were using PHP to compose your frontend.. So you could create a variable inside your header tag.. Then the condition could work.. type, If action activate, change the search address on Erder, Else, remains the same
– Francis Vagner da Luz
Hello Francis. Actually it will not have backend, it is just an institutional site that will have accessibility. Some things I’ve been able to do, like increase the font, go to the content, use the keyboard, but the contrast I’m not getting. Couldn’t you do it with Jquery or Javascript? I saw some examples using 02 links, but I would like to use only 1.
– user24136