javascript - How to change dropdown list label text on click? -
javascript - How to change dropdown list label text on click? -
i have <select>
element in html bound via ng-model
object in scope.
initially want dropdown read "group..." when user clicks on command want "group..." renamed "all" "group..." can never selected, in same sense sites utilize text boxes default text gives hint form , disappears when gets user focus (e.g. "search..." field).
here jsfiddle illustration isn't working expected: http://jsfiddle.net/txpjz/561/
i figured ng-onclick="myoptions[0].label = 'all'"
work, should alter value of info construction populates dropdown , alter dropdown options doesn't.
how create work want?
ng-click
directive want, not ng-onclick. using seems work way want to:
http://jsfiddle.net/txpjz/562/
javascript angularjs drop-down-menu
Comments
Post a Comment