Below is my HTML Code, the alert Message returns **Undefined** i.e the "div\_" is not created.

Please help to resolve this:

```
var piediv = document.createElement('div');
piediv.id = "div_" ;
alert($('#div_').attr('id'));

```