我想更改链接颜色 onclick,链接是基于 ajax 的,我尝试了很多但没有成功我该如何更改它,请求操作正在此页面上进行。
<div class="topheading-right">
<span>
<?php echo $this->Manager->link('Archived Events', array('a'));?>
</span>
<?php echo $this->Manager->link('View All', array(''));?>
</div>
</div>
<div id='events-event_list' class='dashboard-<?php echo __l($product_name);?>s'>
<?php echo $this->requestAction(array('controller'=>'events', 'action'=>'view_event_list', $is_archive), array('return'));?>
</div>
我该怎么做?提前致谢
最佳答案
如果是 AJAX 链接,则不能使用 :visited
伪选择器。
相反,使用:
$('a').live('click',function(){this.style.css.color='red'})
或类似的东西
关于javascript - 单击时如何更改链接的颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15062416/