public HtmlTag WithEmptyAttribute(string name) { if (!HaveAttribute(name)) { var attr = new HtmlAttribute(name, this); attr.WithNovalue(); _attributes.Add(attr.Name, attr); } return this; }
public HtmlTag WithAttribute(string name, object value) { if (!HaveAttribute(name)) { var attribute = new HtmlAttribute(name, this); if (value == null) { attribute.WithNovalue(); } else { attribute.WithValue(value); _attributes.Add(attribute.Name, attribute); } } return this; }