locate

searches a node with the specified attribute in all parents of the specified node (or from the target of the specified event) inclusively and returns the value of the first occurrence

string locate(Event|HTMLElement ev,string name);

Parameters

evEvent|HTMLElementa DOM node or a native HTML event
namestringthe name of an attribute

Returns

stringthe attribute value or null

Example

<input type="radio" id="myradio" name="Color" value="Blue">
var elem = document.getElementById("myradio");
var ev = elem.onclick = locateFunc;
 
function locateFunc(e)
{
    alert(webix.html.locate(e, "name"));     //returns 'Color' (takes the event object)
    alert (webix.html.locate(elem, "value")); //returns 'Blue'  (takes the node)
}

Back to top