我试图使用下面的Jquery语句设置一条消息。" Here"在消息中应该链接到href链接..
如何使用相同的Jquery stmt?
$('#message').html('Access Denied: .Click Here to login with your card.')
答案 0 :(得分:1)
$('#message').html('Access Denied: .Click <a href="mylink.html">Here</a> to login with your card.')
jQuery将在插入时解析字符串中的html。
答案 1 :(得分:0)
尝试这样的事情:
$(document).ready(function(){
$("#test").click(function(){
var link = "<a href='www.google.cl'>Here</a>"
$('#message').html('Access Denied: .Click '+link+' to login with your card.')
});
});