function SetTooltip() { var sPrefix = 'Tooltip.'; //Getting all the elements from body which are Anchor tag var docElemnts = document.getElementsByTagName('a'); alert(docElemnts); for (var e = 0; e < docElemnts.length; e++) { with (docElemnts[e]) { //Check founded Anchor tag is belongs to Tooltip if (getAttribute('rel') != undefined && getAttribute('rel') != null) { var rel = getAttribute('rel'); //Check whether current element has rel attribute with "Tooltip." if (rel.indexOf(sPrefix) >= 0) { var key = rel.split(sPrefix)[1]; for (tip in aTooltips) { var str = aTooltips[tip]; //Perform a case-sensitive search if (str.search(key) == 0) { var Tooltip = str.split('¦')[1]; docElemnts[e].setAttribute('TooltipTitle', Tooltip.split('|')[0]); docElemnts[e].setAttribute('TooltipDescription', Tooltip.split('|')[1]); //Automatically attach mouse over and mouse out event to the Grid Action Button alert(docElemnts[e].onmouseover); docElemnts[e].onmouseover = AttachTooltip; docElemnts[e].onmouseout = function () { hideTooltip('DivTooltip'); } break; } } } } } } } //Attaching event to the current element of the Grid Action Button function AttachTooltip(e) { if (!e) var e = window.event; showTooltip(e, 'DivTooltip', this.getAttribute('TooltipTitle'), this.getAttribute('TooltipDescription')); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)