Wednesday, July 18, 2012

HTML/JavaScript - Unselect/Deselect items in options listbox

If you have an HTML select with several options and you need to unselect everything, just do the following by a simple JavaScript function:

document.getElementById('lstbx_01).selectedIndex = -1;

Cheers!

No comments:

Post a Comment