• Skip to primary navigation
  • Skip to content
  • Skip to footer
  • ZK Getting Started
  • ZK Essentials
  • ZK Developer's Reference
  • ZK MVVM Reference
  • ZK Component Reference
  • ZUML Reference
  • Small Talks
  • ZK Installation Guide
  • ZK Configuration Reference
  • ZK Style Customization Guide
  • ZK Component Development Essentials
  • ZK Client-side Reference
  • ZK Charts Essentials
  • ZK Pivottable Essentials
  • ZK Calendar Essentials
  • Keikai
  • ZK Spring Essentials
  • ZK Webdriver
  • ZATS Essentials
  • ZK JSP Tags Essentials
  • ZK Studio Essentials
  • Latest JavaDoc
  • Latest JavaScript Doc
  • Legacy APIs
  • Deprecated Documentations
      /zuml_ref/attr.html
    • ZUML
    • Languages
      • ZUL
      • XHTML
      • XML
    • Namespaces
      • Annotation
      • Client
      • Client Attribute
        • Data-Swipeable
        • Data-Scrollable
        • Data-EmbedScrollbar
        • Data-FixScrollPosition
        • Data-AnimationSpeed
      • Native
      • ZK
    • Elements
      • attribute
      • custom-attributes
      • template
      • zk
      • zscript
    • Attributes
      • apply
      • forEach
      • forEachBegin
      • forEachEnd
      • forward
      • fulfill
      • if
      • unless
      • use
    • Texts
    • Processing Instructions
      • component
      • evaluator
      • forward
      • function-mapper
      • header
      • import
      • init
      • link
      • meta
      • page
      • root-attributes
      • script
      • style
      • taglib
        • Custom Taglib
      • variable-resolver
      • xel-method
    • EL Expressions
      • Literals
      • Operators
      • Type Coercion
      • String Concatenation
      • Static Fields and Methods
      • Implicit Objects (Predefined Variables)
        • applicationScope
        • arg
        • componentScope
        • cookie
        • desktop
        • desktopScope
        • each
        • event
        • execution
        • header
        • headerValues
        • forEachStatus
        • labels
        • page
        • pageContext
        • pageScope
        • param
        • paramValues
        • requestScope
        • self
        • session
        • sessionScope
        • spaceOwner
        • spaceScope
        • zk
      • Core Methods
        • attr
        • boolean
        • browser
        • cat
        • cat3
        • cat4
        • cat5
        • char
        • class
        • decimal
        • eatQuot
        • encodeThemeURL
        • encodeURIComponent
        • encodeURL
        • endsWith
        • escapeXML
        • formatDate
        • formatNumber
        • getCurrentLocale
        • indexOf
        • int
        • isInstance
        • join
        • l
        • l2
        • lastIndexOf
        • length
        • new
        • new1
        • new2
        • new3
        • number
        • parseDate
        • parseNumber
        • property
        • render
        • replace
        • split
        • startsWith
        • string
        • substring
        • testCurrentLocale
        • toLowerCase
        • toUpperCase
        • trim
    • Extensions
      • zscript
      • EL Expressions

    attr

    On this page

    java.lang.String attr(java.lang.String, java.lang.Object)
    

    i.e., org.zkoss.xel.fn.XmlFns#attr(java.lang.String, java.lang.Object)

    Generates an attribute for HTML/XML, name=”value”. If value is null or empty (if String), “” is generated.

    Twitter Facebook LinkedIn
    © 2026 Potix Corporation. Privacy Policy