Vote count:
0
this is my view page:
<div class="col-lg-3 col-md-4 col-sm-6">
Sort By :
<div class="btn-group">
<button type="button" id="sizevalue" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
Posted Date
<span class="caret"></span>
</button>
<ul id="sizelist" class="dropdown-menu" role="menu">
<li data-value="Name"><a href="#" onclick="abc('Name');">Name </a></li>
<li data-value="Ratings High"><a href="#">Ratings High</a></li>
<li data-value="Ratings Low"><a href="#">Ratings Low</a></li>
<li data-value="Service Charge High"><a href="#" onclick="abc('MaxCharge');">Service Charge High</a></li>
<li data-value="Service Charge Low"><a href="#" onclick="abc('MinCharge');">Service Charge Low</a></li>
</ul>
</div>
</div>
now i want to display whatever is selected in this dropdown.like if i am selecting name then it should display Name in my Button Type.
if i am selecting Ratings High then it should display in my Button Type.
this is my jquery Code but is is not working.
$(document).ready(function () {
$('.dropdown-menu a').on('click', function (e) {
e.preventDefault();
var $this = $(this).parent();
alert($('#sizevalue').val($this.data('value')));
});
});
can anybody plz help me????
asked 50 secs ago
selected anchor tag value not displaying in my button type with jquery
Aucun commentaire:
Enregistrer un commentaire