如何获得价值mysite.com/Mycontrollername/Myactionname?dId=12&tID=2
在获得链接的值当鼠标移到下面的链接:鼠标使用jQuery
<%: Html.ActionLink("test", "Myactionname", "Mycontrollername",
new { dId = 12,tID = 2 }, null)%>
如何获得价值mysite.com/Mycontrollername/Myactionname?dId=12&tID=2
在获得链接的值当鼠标移到下面的链接:鼠标使用jQuery
<%: Html.ActionLink("test", "Myactionname", "Mycontrollername",
new { dId = 12,tID = 2 }, null)%>
$('.selectedcategory').mouseover(function() {
console.log($(this).text());
});
$('.selectedcategory').mouseenter(function() {
var href = $(this).attr('href');
});
延伸阅读:
$('.selectedcategory').mouseover(function() {
console.log($(this).attr("href"));
});
确定我得到它,你移除了锚标记类,你有两个选择要么添加mouseover
事件处理程序的每一个锚标记像
$('a').mouseover(function(e) {
e.stopPropagation();
if($(this).text()=='test')
console.log($(this).attr("href"));
});
或您筛选具有文本 “test
” 像
$('a').filter(function(){return $(this).text()=='test'}).mouseover(function(e) {
e.stopPropagation();
console.log($(this).attr("href"));
});
对不起,我错了锚标记。我编辑了我的问题。 – titi 2012-02-17 09:43:24
我不能让你试图获得'ActionLink'产生的锚标签的'href'属性 – Rafay 2012-02-17 09:53:21