# Widget Helper stripping attributes?

**URL:** <https://meta.discourse.org/t/widget-helper-stripping-attributes/68014>\
**Category:** Development\
**Created:** [14 Agosto 2017, 2:06pm UTC](https://meta.discourse.org/t/widget-helper-stripping-attributes/68014 "2017-08-14T14:06:56Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Bas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bas/32/294929_2.png) [@Bas](https://meta.discourse.org/u/Bas)\
**Post date:** [14 Agosto 2017, 2:06pm UTC](https://meta.discourse.org/t/widget-helper-stripping-attributes/68014/1 "2017-08-14T14:06:57Z")

</div>

I was trying my hand at my first plugin, and to a certain extent [it worked quite OK](https://github.com/VonLion/discourse-menu-icon) 🙂

However, I’m having trouble with the helper class. The class seems to strip out certain attributes and I have no idea what’s happening.

I’m adding an `\<a>` with some classes and a few attributes.

I’m trying to add

- id
- href
- title
- aria-label
- \_target

The first three work fine, the last two don’t.

I’ve tried to reorder and rename the attributes. But it seems there is some sort of selection happening?

Snippet:

```javascript
decorateWidget('header-icons:before', helper => {
    return h('li.header-dropdown-toggle', [
        h('a.icon.btn-flat', {
                'id': 'my id',
                'href': 'http://example.com',
                'title': 'my title',
                'aria-label': 'my label',
                '_target': "_blank"
            }, [
                h('i.fa.fa-info.d-icon', {
                    'aria-hidden': 'true'
                })
            ]
        ),
    ]);
});

```

Rendered as

 ![45](https://global.discourse-cdn.com/meta/original/3X/3/f/3fa0e6133d4e14fc7d521b1ff6a59550f046ffc8.png)

---

_[View the full topic](https://meta.discourse.org/t/widget-helper-stripping-attributes/68014)._
