Question: Can you get the `id` attribute of a html tag using jQuery or without?

For example:

```
<ul id="todo" />

```

How can I get the `id`, without using `jQuery("#todo")`?

Is there a way for that? Will `attr()` work?

Answer: 
The way I see it, you most probably need to attach a selector class to the **ul** so that you can use it to get the id:

```
<ul id="todo" class="todoclassname" />

```

then, you can get the id by doing:

```
$(".todoclassname").attr("id");

```
Yes, you can use `.attr('id')` to get the id of an element