Title: Widgets: Del.icio.us Widget: Adding &#8216;class&#8217;
Last modified: August 18, 2016

---

# Widgets: Del.icio.us Widget: Adding ‘class’

 *  [haipunk](https://wordpress.org/support/users/haipunk/)
 * (@haipunk)
 * [19 years, 7 months ago](https://wordpress.org/support/topic/widgets-delicious-widget-adding-class/)
 * Hey!
 * I’m using WordPress Widgets with the del.icio.us Widget. Every `<ul>` element
   in my sidebar has a class, something like class=’icon comment’ which adds an 
   nice comment-icon at every `<li>`.
 * I also want to to use these class-elements at my del.icio.us-linklist, but there
   is only this code in the .php-file:
 * `var ul = document.createElement('ul');`
 * Can someone help me how to add the class-element here?
 * Link:
    Wordpress Widgets: [http://automattic.com/code/widgets/](http://automattic.com/code/widgets/)(
   includes del.icio.us Widget)

Viewing 1 replies (of 1 total)

 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [19 years, 7 months ago](https://wordpress.org/support/topic/widgets-delicious-widget-adding-class/#post-473389)
 * Look lower. The delicious widget UL gets an ID of “delicious-list” via this bit
   of PHP code:
    `ul.setAttribute('id', 'delicious-list');`
 * If you really want to set a class on it, you can do this just after that:
    `ul.
   setAttribute('class', 'your_class');` Or whatever you prefer.
 * Alternatively, given that it already has an ID, you can add that ID to your existing
   CSS and thus style it directly. This would be best as it doesn’t involve changing
   the code, so if you upgrade the widget later, you don’t have to hack the code
   again. Just add “#delicious-list” to the given chunk of CSS code that does the
   icon thing.

Viewing 1 replies (of 1 total)

The topic ‘Widgets: Del.icio.us Widget: Adding ‘class’’ is closed to new replies.

## Tags

 * [class](https://wordpress.org/support/topic-tag/class/)
 * [del.icio.us](https://wordpress.org/support/topic-tag/del-icio-us/)
 * [ul](https://wordpress.org/support/topic-tag/ul/)
 * [widgets](https://wordpress.org/support/topic-tag/widgets/)

 * 1 reply
 * 2 participants
 * Last reply from: [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * Last activity: [19 years, 7 months ago](https://wordpress.org/support/topic/widgets-delicious-widget-adding-class/#post-473389)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
