# HG changeset patch # User Jaroslav Tulach # Date 1358018872 -3600 # Node ID 42f0ad9e41526eaf946f1156d66476efc632ec53 # Parent fb4ed6cc0d4bf534586b14161d6e593bee1544ec Generic methods for querying and changing attributes diff -r fb4ed6cc0d4b -r 42f0ad9e4152 javaquery/api/src/main/java/org/apidesign/bck2brwsr/htmlpage/api/Element.java --- a/javaquery/api/src/main/java/org/apidesign/bck2brwsr/htmlpage/api/Element.java Sat Jan 12 20:24:30 2013 +0100 +++ b/javaquery/api/src/main/java/org/apidesign/bck2brwsr/htmlpage/api/Element.java Sat Jan 12 20:27:52 2013 +0100 @@ -62,5 +62,20 @@ */ @JavaScriptBody(args = "msg", body = "alert(msg);") public static native void alert(String msg); + + /** Generic way to query any attribute of this element. + * @param property name of the attribute + */ + public final Object getAttribute(String property) { + return getAttribute(this, property); + } + /** Generic way to change an attribute of this element. + * + * @param property name of the attribute + * @param value value to associate with the attribute + */ + public final void setAttribute(String property, Object value) { + setAttribute(this, property, value); + } }