您好我正在使用jquery函数获取所有标签属性,现在我想将它们存储到一个并追加到正文中,但无法找到如何完成它的方式。这里是fiddle链接在jquery中添加两个以上的变量到一个变量
<head>
<script type="text/javascript">
$(function(){
$('a').click(function(){
var name= $(this).attr('name');
var href= $(this).attr('href');
var jj= $(this).attr('class');
var user_id= $(this).attr('user_id');
var page_type= $(this).attr('page_type');
var price= $(this).attr('price');
var bonus= $(this).attr('bonus');
var wrapper= $(this).attr('wrapper');
var token= $(this).attr('token');
var own= $(this).attr('own');
$('body').append('<div>'+name+'<div>')
})})
</script>
</head>
<body>
<a id="profile_2902" name="b_now" href="#" class="big_now" user_id="152402569967" page_type="profile" price="292" bonus="0" wrapper="5972569967" token="e644ce48aa43dc3caa348745a" own="4100447132">
Click now!
</a>
</body>
您可以向我们展示一下您希望输出的样本吗? – Lix