jQuery-onClick获取此属性id的内容';s等于变量html

jQuery-onClick获取此属性id的内容';s等于变量html,jquery,Jquery,我有一个html模板列表。单击锚定标记后,应获取HTML并显示为与此属性id相等的输出 Eg:如果我点击01链接,输出应该是Content 01,02应该带来Content 2等等 目前我被点击rp wp模板id作为wpt\u bars\u 1等。。。相反,我想得到与这个id相等的varibale html 所需输出应为: 输出:内容1、2等。 jQuery(document).on('click','wp templates list li a',function(e){ var_self

我有一个html模板列表。单击锚定标记后,应获取HTML并显示为与此属性id相等的输出

Eg:如果我点击01链接,输出应该是Content 01,02应该带来Content 2等等

目前我被点击rp wp模板id作为wpt\u bars\u 1等。。。相反,我想得到与这个id相等的varibale html

所需输出应为: 输出:内容1、2等。

jQuery(document).on('click','wp templates list li a',function(e){
var_self=jQuery(this);
var_wp_template_id=_self.attr('rp-wp-template-id');
var wpt_bars_1=‘内容1’;
var wpt_bars_2=‘内容2’;
var wpt_bars_3=‘内容3’;
var wpt_bars_4=‘内容4’;
var wpt_bars_5=‘内容5’;
jQuery('#getHtmlContainer').html('Output:'+\uwp\utemplate\uid);
});
正文{
字体系列:verdana;
字体大小:13px;
}
李{
保证金:0;
填充:0;
}
a{
文字装饰:无;
显示:块;
颜色:#0066cc;
背景色:#fefe;
边框:1px实心#ccc;
填充物:5px;
宽度:80%;
保证金:0自动20px自动;
}

输出:
您需要一个对象

你也可以更接近你代表团中的李

常数条={
“wpt_bars_1”:“内容1”,
“wpt_bars_2”:“内容2”,
“wpt_bars_3”:“内容3”,
“wpt_bars_4”:“内容4”,
“wpt_bars_5”:“内容5”,
}
$('.wp模板列表')。在('click','li a',函数(e)上{
var _self=$(本);
var_wp_template_id=_self.attr('rp-wp-template-id');
$('getHtmlContainer').html('Output:'+bar[\uwp\uTemplate\uID]);
});
正文{
字体系列:verdana;
字体大小:13px;
}
李{
保证金:0;
填充:0;
}
a{
文字装饰:无;
显示:块;
颜色:#0066cc;
背景色:#fefe;
边框:1px实心#ccc;
填充物:5px;
宽度:80%;
保证金:0自动20px自动;
}

输出:
您需要一个对象

你也可以更接近你代表团中的李

常数条={
“wpt_bars_1”:“内容1”,
“wpt_bars_2”:“内容2”,
“wpt_bars_3”:“内容3”,
“wpt_bars_4”:“内容4”,
“wpt_bars_5”:“内容5”,
}
$('.wp模板列表')。在('click','li a',函数(e)上{
var _self=$(本);
var_wp_template_id=_self.attr('rp-wp-template-id');
$('getHtmlContainer').html('Output:'+bar[\uwp\uTemplate\uID]);
});
正文{
字体系列:verdana;
字体大小:13px;
}
李{
保证金:0;
填充:0;
}
a{
文字装饰:无;
显示:块;
颜色:#0066cc;
背景色:#fefe;
边框:1px实心#ccc;
填充物:5px;
宽度:80%;
保证金:0自动20px自动;
}


输出:
@mplugjan,谢谢你的完美答案。。。我接受并投票赞成你的回答。谢谢你的时间。@mplugyan,谢谢你的完美回答。。。我接受并投票赞成你的回答。谢谢你抽出时间。