I'm not finding a way to do what you're looking for either, at least with the standard snippet definitions.
I've created an improved snippet for that which you can start using by placing
the following in ~/.vim/UltiSnips/html.snippets
(my version of that file is available from
GitHub):
clearsnippets div
snippet div "XHTML <div>"
<div`!p snip.rv=' id="' if t[1] else ""`${1:name}`!p snip.rv = '"' if t[1] else ""``!p snip.rv=' class="' if t[2] else ""`${2:name}`!p snip.rv = '"' if t[2] else ""`>
$0
</div>
endsnippet
This will provide both id
and class
attributes by default, eliminating the
one(s) where the value is deleted.
The official version of UltiSnips on GitHub now includes this version of the snippet.