
<script type="text/javascript">
<!-- function get_idx(_this_) {
alert(_this_.id);
var idx;
idx=_this_.parentNode.parentNode.firstChild.getAttribute('d_idx');
alert(idx);
idx=_this_.parentNode.parentNode.firstChild.
nextSibling.
getAttribute('d_idx');
alert(idx);
return false;
}
//--> </script>
<style>
.a { width: 200px; border: 1px solid; height: 40px; float: left; }
.b,.c { border: 1px solid; width: 40px; height: 40px; float: left; }
</style>
<div d_idx="1"><div d_idx="2">test 123456</div><div d_idx="3">123</div><div><a id="test1" href="#" onClick="get_idx(this)">usuń</a></div></div>

getProperty => getAttribute

function initLinks() {
if (!document.getElementsByTagName) { return; }
var anchors = document.getElementsByTagName(„a”);
for (var i=0; i<anchors.length; i++){
var anchor = anchors[i];
if (anchor.getAttribute(„href”) && /^mapa_/i.test(anchor.id)) {
anchor.onclick = function () {
jakas_funkcja(this);
}
}
}
};

function get_title(obj) {
var title = ”;
if(obj.getAttribute(‘title’)) {
title = obj.getAttribute(‘title’);
title = title.substring(5);
}
return {title:title,value:title};
}

<head>
<script type=”text/javascript”>
window.onload = function()
{
document.getElementById(‘link’).onclick = Info;
}
function Info()
{
alert(window.event.type);
alert(this.getAttribute(‘title’));
}
</script>
</head>
<body>
<a href=”#” id=”link” title=”Miasto Warszawa, Lublin, Chełm, Zamość”>zobacz miasta z title linku</a>
</body>
Strona zawiera sposoby oraz kody źródłowe pokazujące rozwiazanie napotkanych problemów