короткий английский...
мой html
<button><span id="popMain"> pop </span></button>
$(document).bind({
click : function(evt){
var targetID = evt.target.id;
var nodeName = evt.target.nodeName;
}
когда я использую explorer, я хочу получить идентификатор span.
я попробую
$(this).find('span').attr('id');
$(this).find('span').id;
$("#"+evt.target.id).children('span').attr('id');
$("#"+evt.target.id).find('span:first-child').attr('id');
$("#"+evt.target.id).find('span:last-child').attr('id');
но результат "undefined". T ^ T plz помогите мне...
Это работало для меня в проводнике:
$("span:first").attr('id');
Орфографическая ошибка:
$(this).find('span').attr('id');
$(this).find('span').id;
$("#"+evt.target.id).childeren('span').attr('id'); // children not childeren.
$("#"+evt.target.id).find('span:first-child').attr('id');
$("#"+evt.target.id).find('span:last-child').attr('id');
$("#"+evt.target.id).childeren('span').attr('id');
в$("#"+evt.target.id).children('span').attr('id');