# jQuery-plugin-getPath **Repository Path**: mirrors_FGRibreau/jQuery-plugin-getPath ## Basic Information - **Project Name**: jQuery-plugin-getPath - **Description**: jQuert getPath - Find a (possible) jQuery selector of an HTML element. - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-09-24 - **Last Updated**: 2026-05-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # jQuery getPath ![libscore](http://img.shields.io/badge/libscore-58-brightgreen.svg?style=flat-square) ------------------ In some specific situations you may want to identify an HTML element in an unique way - with a jQuery Selector or XPath - in order to select it in another browser - different DOM - (for example: visitor mouse & keyboard real-time monitoring). ## Usage $('body').bind('click.monitoring',function(e){ //Get the element's jQuery selector //It'll return something like this: #example-5>h4:eq(0) var sel = $.getPath(e.target); //is the same as $(e.target).getPath(); //Send to the server what element was clicked //(and maybe replicate this event on the administrator screen) $.post('/myMonitoringServer.php',{ evtTarget:sel, evtType:'onClick' }); return false; }); $.getPath(el); may return jQueryPath_document or jQueryPath_window. They just are equivalents for window.document and window object because jQuery doesn't have any selector for them. ## Workaround var $el, path = $.getPath(window); if(path === 'jQueryPath_document') $el = $(document); else if(path === 'jQueryPath_window') $el = $(window); else $el = $(path); //So here, $el == window ## Donate [Donate Bitcoins](https://coinbase.com/checkouts/fc3041b9d8116e0b98e7d243c4727a30)