# Attribute “st_title” not allowed on element “span” at this point.

> Canonical HTML version: https://rocketvalidator.com/html-validation/attribute-st-title-not-allowed-on-element-span-at-this-point
> Attribution: Rocket Validator (https://rocketvalidator.com)
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

HTML has a defined set of global attributes (such as `id`, `class`, `lang`, and `title`) and element-specific attributes. Any attribute that isn't part of these recognized sets will trigger a validation error. The `st_title` attribute is a proprietary, non-standard attribute that was used by older versions of the ShareThis sharing widget to pass metadata — specifically, the title of the content being shared.

The HTML5 specification introduced `data-*` attributes as the standard mechanism for embedding custom data on elements. These attributes allow developers to store arbitrary information without conflicting with the HTML spec. Newer versions of ShareThis and similar services have adopted this convention, but legacy code — especially in CMS themes, plugins, or modules — may still use the old non-standard format.

Using invalid attributes causes several problems:

- **Standards compliance:** The document fails W3C validation, which can indicate deeper markup quality issues.
- **Future compatibility:** Browsers are not required to handle non-standard attributes in any predictable way. Future browser updates could ignore or strip them.
- **Maintainability:** Non-standard attributes make code harder for other developers to understand and maintain.
- **Accessibility tools:** Screen readers and other assistive technologies rely on well-formed HTML. Invalid attributes can cause unexpected behavior in these tools.

To fix this, replace all proprietary ShareThis attributes with their `data-*` equivalents. For example, `st_title` becomes `data-st-title`, `st_url` becomes `data-st-url`, and `displayText` becomes `data-st-displaytext`. You should also update the ShareThis JavaScript library to a version that recognizes the new attribute format.

## Examples

### ❌ Invalid: Using proprietary attributes

```html
<span class="st_sharethis" st_title="My Article" st_url="https://example.com/article" displayText="ShareThis">
  Share
</span>
```

This triggers validation errors for `st_title`, `st_url`, and `displayText` because none of these are valid HTML attributes.

### ✅ Valid: Using `data-*` attributes

```html
<span class="st_sharethis" data-st-title="My Article" data-st-url="https://example.com/article" data-st-displaytext="ShareThis">
  Share
</span>
```

All custom data is now stored in properly namespaced `data-*` attributes, which are fully compliant with the HTML5 specification.

### ✅ Valid: Using a button element with `data-*` attributes

If the element is interactive (e.g., it triggers a share action on click), consider using a `<button>` instead of a `<span>` for better accessibility:

```html
<button type="button" class="st_sharethis" data-st-title="My Article" data-st-url="https://example.com/article">
  Share this article
</button>
```

### Fixing this in a CMS

If you're using Drupal, WordPress, or another CMS with a ShareThis module or plugin:

1. **Update the plugin/module** to the latest version — most have already migrated to `data-*` attributes.
2. **Check your theme templates** for hardcoded ShareThis markup that may still use the old attribute format.
3. **Search your codebase** for `st_title`, `st_url`, and `displayText` and replace them with `data-st-title`, `data-st-url`, and `data-st-displaytext` respectively.
4. **Update the ShareThis JavaScript** to a version compatible with the new attribute names, and verify that sharing functionality still works after the change.
