Open.Core.Html.GetOrCreateId C# (CSharp) Method

GetOrCreateId() public static method

Gets the elements ID, creating a unique ID of the element doesn't already have one.
public static GetOrCreateId ( jQueryObject element ) : string
element jQueryObject The element to get the ID for.
return string
        public static string GetOrCreateId(jQueryObject element)
        {
            string id = element.GetAttribute(Id);
            if (string.IsNullOrEmpty(id))
            {
                id = Helper.CreateId();
                element.Attribute(Id, id);
            }
            return id;
        }