Example #1
0
/**
 * focus - this method adds the focus to this element
 *
 * params - none
 * return - void
 */
JSBool jhtml_input_focus(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
	HTMLElement *pElem = (HTMLElement *) jhutil_GetPrivate(cx, obj);

	if (!pElem)
	{
		return JS_TRUE;
	}

	pElem->Focus();

	*rval = JSVAL_VOID;
	return JS_TRUE;
}
Example #2
0
/**
 * focus() - This method puts the focus on this element
 *
 * params - none;
 * return - void
 */
JSBool jhtml_anchor_focus(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
	LOG_HTMLDOM("jhtml_anchor_focus\n");

	if (JS_GetClass(obj) == &JSHtmlAnchorElement)
	{
		HTMLElement *pElem = (HTMLElement *) jhutil_GetPrivate(cx, obj);

		if (!pElem)
		{
			return JS_TRUE;
		}

		pElem->Focus();
	}

	*rval = JSVAL_VOID;
	return JS_TRUE;
}