Simplified selection with javascript