I want to write a function
function f (domEl){
//some code here
//returns a string
}
such that:
$(f(domEl))[0] == domEl
should always return true (of course, regardless at what hierarchy domEl is):
As an example, Let’s say:
HTML
body
ul
li
**li**
li
ul
li
and, I want to select bold li element. I get that element and pass that into my function f.
DEMO: http://jsfiddle.net/vzWgb/
The selector looks like this (for the code I used in the example)…