Question: Let's say I have the following snippet:

```
snippet divt
    <div id="${1:div_id}">
        ${2:'some text'}
    </div>

```

So when I type divt and hit tab twice "'some text'" should be selected, and when I hit tab once more I would like "some text" to be selected (witoutht single quotes). How can I do it?

Edit 1: Thanks for your answers. Probably this example makes more sense:

> 
> 
> ```
> snippet divt
>     <div ${1:id="${2:div_id}"}>
>     </div>
> 
> ```
> 
> 

Sometimes I want a div without an id, so i need to be able to delete the id="div\_id" altogether. Sometimes i'd like to have an id, so that i can change div\_id part only.

Answer: 
* You need to `return` the value returned by `confirmDelete`.
* The attribute is `onclick`, not `onClick`.
* The attribute is missing a closing quote.

### JavaScript

```
function confirmDelete(){
    return confirm("Are you sure you want to delete this file?");
}

```

### PHP

```
echo '<a ... onclick="return confirmDelete();" ...';

```

---

That said, it looks like you're using jQuery (albeit a super old version). If that's really the case, **use jQuery** and start writing [unobtrusive JavaScript](http://en.wikipedia.org/wiki/Unobtrusive_JavaScript) already.

```
$(function ()
{
    $('a.delete').click(confirmDelete);
});

```

Get yourself a reasonably recent version of jQuery as well.
This doens't regards jQuery but anyway you could do in this way:

```
<script>
function confirmDelete(idPassed){

  if (confirm("Are you sure you want to delete this file?"))
    window.location = "mysite/raw/sn-extend/theme/default/delete.php?id=" + idPassed;

 }
</script>

<a href="javascript:void(0);" onClick="confirmDelete('<?php echo $streamitem_data['streamitem_id']; ?>');" alt="Delete" title="Delete" class="delete">X</a>

```