I got null in getSelectedText

the following is my code, I am trying to get selectedText onblur
but if i didnt select anyting from the combobox i got null as a text.
how i can solve this issue

z.attachEvent(“onBlur”,function(){
var cval = z.getSelectedValue();
if(!cval==null)
z.setComboText(z.getSelectedText())
z.setComboValue(z.getSelectedValue())
if(z.getSelectedText() == null)
{
z.setComboText("")
}
})

For what purpose did you use onblur event?
Could you explain the problem in detail?